Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

bypassing interceptors

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

How to bypass some of the interceptors in defaultStack provided by Struts2?

Thanks
Chaitanya
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

To bypass some of the interceptors in the default stack.

Create your own interceptor stack and add what interceptors you want to the stack .
As you can also struts 2 by default is providing lot of stacks. you can see all the stacks in struts-default.xml



 
Vivek Chaitanya
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put the following code in struts.xml



Does the above lines of code ensure that only the above interceptors are invoked? How will I verify that?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's just how S2 works--only interceptors in stacks being used are called.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Facing the same problem..

instead of controlling it at configuration level, I want to bypass the execution of Action/next interceptors in the stack .. is it really possible ?
Let me explain my problem in detail here..

I need to check a cookie at interceptor and need to execute different actions based on cookie value.. I tried in below way, I am able to redirect the response to desired action and page but with exceptions. Here is the code ..


Error Message
java.lang.IllegalStateException: Cannot create a session after the response has been committed
org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please start new threads for new questions.
 
reply
    Bookmark Topic Watch Topic
  • New Topic