This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Confused with Built in Inerceptors in Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Confused with Built in Inerceptors in Struts2" Watch "Confused with Built in Inerceptors in Struts2" New topic
Author

Confused with Built in Inerceptors in Struts2

PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212



Are these default interceptors are automatically included for every Action (I am not including the interceptor in my action tag in struts.xml) . Do i need to include them explicitly or they fire implicitly ??

Please help on this .
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Pavan, you can configure the default interceptor stack to be used for your actions in a package using this syntax



Usually when we define a package in struts.xml, then we extend the struts-default package. That package contains a defaultStack which you can see here. So if you don't specify a default interceptor stack for your package, then the defaultStack will be used. Please note that this only happens if you don't explicitly provide an interceptor stack for you action. So if a package contains an action which has no interceptor stack of its own, then the defaultStack will be used. But if an action has an interceptor stack of its own, then the defaultStack will not be applied on that action...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212
Thanks i got the point.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Confused with Built in Inerceptors in Struts2
 
Similar Threads
Struts2 FileUpload - request is nulled
problem in field validation
Overriding default interceptor stack
EJB3 Injection - how to Inject it into struts 2 Action?
interceptor not working