Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Interceptors can be chained together to create an Interceptor "Stack". If an action needed neeeds to check the client's credentials, log the action, and time the action, all of these routines, and more, could be made part of the same Interceptor Stack.

...

Code Block
xml
xml
titleRegistering Interceptors
<interceptors>
  <interceptor name="security" class="com.mycompanycompany.security.SecurityInterceptor"/>
  <interceptor-stack name="secureStack">
    <interceptor-ref name="security"/>
    <interceptor-ref name="defaultStack"/>
  </interceptor-stack>
</interceptors>

...

Code Block
xml
xml
titleA local Interceptor Stack
<action name="VelocityCounter" class="comorg.opensymphonyapache.webworkstruts2.example.counter.SimpleCounter">
   <result name="success">...</result>
   <interceptor-ref name="defaultComponentStack"/>
</action>

...