Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Interceptors are implemented as Java classes, so each Interceptor has a class name. To make it easier to reference Interceptors, each class can be registered with the framework and given a unique, simpler name.

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

...

but any action may also define its own local stack.

Code Block
xml
xml
titleA local Interceptor Stackxml
<action name="VelocityCounter" class="org.apache.struts2.example.counter.SimpleCounter">
    <result name="success">...</result>
    <interceptor-ref name="defaultComponentStack"/>
</action>

...