alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Struts example source code file (xwork-test-interceptor-defaultref.xml)

This example Struts source code file (xwork-test-interceptor-defaultref.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Struts tags/keywords

actionwithdefaultref, actionwithnoref, actionwithnoref, actionwithownref, actionwithownref, anotheractionwithownref, anotheractionwithownref, doctype, doctype, group//xwork, opensymphony, public

The Struts xwork-test-interceptor-defaultref.xml source code

<!DOCTYPE xwork PUBLIC
    "-//OpenSymphony Group//XWork 1.1.1//EN"
    "http://www.opensymphony.com/xwork/xwork-1.1.1.dtd"
 >

<xwork>
    <!-- this package has a default interceptor ref - so actions with no refs should have the default ref -->
    <package name="default">
        <interceptors>
            <interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
            <interceptor name="logging" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
        </interceptors>

        <default-interceptor-ref name="timer" />
        <action name="ActionWithOwnRef" class="com.opensymphony.xwork2.SimpleAction">
            <interceptor-ref name="logging"/>
        </action>
        <action name="ActionWithDefaultRef" class="com.opensymphony.xwork2.SimpleAction" />
    </package>

    <!-- this package has no default interceptor ref - so actions with no refs should inherit the default interceptor -->
    <!-- this tests that default interceptor refs are inherited -->
    <package name="subpackage" extends="default">
        <action name="ActionWithNoRef" class="com.opensymphony.xwork2.SimpleAction" />

        <action name="AnotherActionWithOwnRef" class="com.opensymphony.xwork2.SimpleAction">
            <interceptor-ref name="logging"/>
        </action>
    </package>
</xwork>

Other Struts examples (source code examples)

Here is a short list of links related to this Struts xwork-test-interceptor-defaultref.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.