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

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

This example Struts source code file (xwork-test-actions.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

bar, barwithoutclassname, barwithoutclassname, doctype, doctype, foo, foobar, foobar, group//xwork, opensymphony, public, testinterceptorparamoverride, testinterceptorparamoverride, wildcard

The Struts xwork-test-actions.xml source code

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

<xwork>
	<include file="xwork-test-beans.xml" />
    <package name="default">
        <result-types>
            <result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult" default="true"/>
            <result-type name="mock" class="com.opensymphony.xwork2.mock.MockResult"/>
        </result-types>

        <interceptors>
            <interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
            <interceptor name="logging" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
            <interceptor name="test" class="com.opensymphony.xwork2.mock.MockInterceptor">
                <param name="foo">fooDefault
            </interceptor>

            <interceptor-stack name="defaultStack">
                <interceptor-ref name="timer"/>
            </interceptor-stack>
        </interceptors>

        <global-results>
            <result name="login"> 
                <param name="actionName">login
            </result>
        </global-results>

        <action name="Bar" class="com.opensymphony.xwork2.SimpleAction">
            <param name="foo">17
            <param name="bar">23
            <param name="testXW412">foo.jspa?fooID=${fooID}&something=bar
            <param name="testXW412Again">
            		something
            </param>
            <param name="testForXW171">
        </action>

        <action name="Foo" class="com.opensymphony.xwork2.SimpleAction">
            <param name="foo">18
            <param name="bar">24
            <result name="success" type="mock" />
            <interceptor-ref name="defaultStack"/>
        </action>

        <action name="WildCard" class="com.opensymphony.xwork2.SimpleAction">
            <result name="*" type="mock" />
            <interceptor-ref name="defaultStack"/>
        </action>

        <action name="FooBar" class="com.opensymphony.xwork2.SimpleAction">
            <param name="foo">18
            <param name="bar">24
            <result name="success" type="mock" />
            <interceptor-ref name="defaultStack"/>
            <exception-mapping name="runtime" exception="java.lang.RuntimeException" result="exception"/>
        </action>

        <action name="TestInterceptorParam" class="com.opensymphony.xwork2.SimpleAction">
            <interceptor-ref name="test">
                <param name="expectedFoo">expectedFooValue
            </interceptor-ref>
        </action>

        <action name="TestInterceptorParamOverride" class="com.opensymphony.xwork2.SimpleAction">
            <interceptor-ref name="test">
                <param name="foo">foo123
                <param name="expectedFoo">expectedFooValue
            </interceptor-ref>
        </action>

        <action name="BarWithoutClassName">
            <param name="foo">17
            <param name="bar">23
        </action>

    </package>
</xwork>

Other Struts examples (source code examples)

Here is a short list of links related to this Struts xwork-test-actions.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.