• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused with Built in Inerceptors in Struts2

 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks i got the point.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic