Commits

tm_jee  committed e304115

- checked in some examples for xwork2 confluence doc

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1170e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits df1fe87

Comments (0)

Files changed (2)

File showcase/src/java/com/opensymphony/xwork2/showcase/interceptorExample/xwork-interceptor-example.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xwork PUBLIC 
+	"-//OpenSymphony Group//XWork 1.1.1//EN"
+	"http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
+	
+<xwork>
+	<include file="xwork-default.xml" />
+	<package name="default-interceptor-example" namespace="/interceptorExample">
+		<result-types>
+			<result-type name="printToConsole" class="com.opensymphony.xwork2.showcase.PrintToConsoleResult" />
+		</result-types>
+	
+		<interceptors>
+			<interceptor name="interceptor1" class="com.opensymphony.xwork2.showcase.interceptorExample.Interceptor1" >
+				<param name="param">paramValue1</param>
+			</interceptor>
+			<interceptor name="interceptor2" class="com.opensmyphony.xwork2.showcase.interceptorExample.Interceptor2">
+				<param name="param">paramValue2</param>
+			</interceptor>
+			<interceptor name="interceptor3" class="com.opensymphony.xwork2.showcase.interceptorExample.Interceptor3">
+				<param name="param">paramValue2</param> 
+			</interceptor>
+			<interceptor-stack name="myInterceptorStack">
+				<interceptor-ref name="interceptor1" />
+				<interceptor-ref name="interceptor2" />
+				<interceptor-ref name="interceptor3" />
+			</interceptor-stack>
+		</interceptors>
+		
+		<action name="interceptorExampleAction1" 
+		class="com.opensymphony.xwork2.showcase.interceptorExample.Action1"
+		>
+			<interceptor-ref name="interceptor1" />
+			<interceptor-ref name="interceptor2" />
+			<result type="printToConsole">InterceptorExample - Action1 - Result</result>
+		</action>
+		
+		<action name="interceptorExampleAction2" class="com.opensymphony.xwork2.showcase.interceptorExample.Action2">
+			<interceptor-ref name="myInterceptorStack" />
+			<result type="printToConsole">InterceptorExample - Action2 - Result</result>
+		</action>
+		
+		<action name="interceptorExampleAction3" class="com.opensymphony.xwork2.showcase.interceptorExample.Action3">
+			<interceptor-ref name="interceptor1">
+				<param name="param">new paramValue1</param>
+			</interceptor-ref>
+			<result type="printToConsole">InterceptorExample - Action3 - Result</result>
+		</action>
+		
+		<action name="interceptorExampleAction4" class="com.opensymphony.xwork.showcase.interceptorExample.Action4">
+			<interceptor-ref name="myInterceptorStack">
+				<param name="interceptor1.param">new paramValue1</param>
+			</interceptor-ref>
+			<result type="printToConsole">InterceptorExample - Action4 - Result</result>
+		</action>
+	</package>
+</xwork>		
+	
+	

File showcase/src/java/com/opensymphony/xwork2/showcase/validationExample/ValidationExampleAction-validation.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE validators PUBLIC 
+	"-//OpenSymphony Group//XWork Validator 1.0.2//EN" 
+	"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<!-- START SNIPPET: xwork-validation -->
+<validators>
+	<validator type="expression">
+		<param name="expression"><![CDATA[name != null && age != null]]></param>
+		<message>Both fields are required</message>
+	</validator>
+	<field name="name">
+		<field-validator type="requiredstring">
+			<message>Name is mandatory</message>
+		</field-validator>
+	</field>
+	<field name="age">
+		<field-validator type="requiredstring">
+			<message>Age is mandatory</message>
+		</field-validator>
+		<field-validator type="int">
+			<param name="min">20</param>
+			<param name="max">50</param>
+			<message>Age must be between 20 and 50</message>
+		</field-validator>
+	</field>
+</validators>
+<!-- END SNIPPET: xwork-validation -->
+