Versions Compared

Key

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

...

Code Block
xml
xml
<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.1.dtd">

<xwork>
    <!-- Include webwork defaults (from WebWork JAR). -->
    <include file="webwork-default.xml"/>
    
    <!-- Configuration for the default package. -->
    <package name="default" extends="webwork-default">
        <action name="listPeople" class="com.acme.ListPeople">
            <result type="freemarker">listPeople.ftl</result>
        </action>

        <action name="newPerson" class="com.acme.CreatePerson">
            <result type="redirect">listPeople.action</result>
            <result name="input" type="freemarker">newPerson.ftl</result>
        </action>
    </package>
</xwork>

Grouping interceptors as stacks

With most web applications, you'll find yourself wanting to apply the same interceptors over and over. Rather than declare numerous interceptor-refs for each action, you can bundle these interceptors together using an interceptor stack.

Looking inside webwork-default.xml we can see how it's done:

...