取个小例子:
这是网页:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<body>
<s:actionerror/>
<s:form action=
"LoginAction"
method=
"post"
>
<s:token></s:token>
<s:textfield name=
"produ"
label=
"预定产品的编号"
/>
<s:textfield name=
"onum"
label=
"预定数量"
/>
<s:submit value=
"提交"
></s:submit>
</s:form>
</body>
|
这是struts-xml配置文件:
<action name="LoginAction" class="sedion.xq.action.LoginAction">
<interceptor-ref name="token"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result>
/dakjfhkah.jsp
</result>
<result name="invalid.token">/index.jsp</result>
</action>
or
<action name="LoginAction" class="sedion.xq.action.LoginAction">
<interceptor-ref name="tokenSession"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result>
/dakjfhkah.jsp
</result>
</action>