<body> <form action="user" method="post"> name:<input name="name"> age:<input name="age"> <input type="submit" value="add"> <s:token></s:token> </form><br> </body>
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <constant name="struts.devMode" value="true"></constant> <package name="test" namespace="/" extends="struts-default"> <action name="input" class="com.bjsxt.action.InputAction"> <result>/input.jsp</result> </action> <action name="user" class="com.bjsxt.action.UserAction"> <result>/addOK.jsp</result> <interceptor-ref name="defaultStack"></interceptor-ref> <interceptor-ref name="token"></interceptor-ref> <result name="invalid.token">/error.jsp</result> </action> </package> </struts>