index.jsp
<body>
<%out.println(3+5); %>
<a href="go_v">ZouYiGe</a>
</body>
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="go_v" class="liulixin.test_validate">
<result name="success">/haha.jsp</result>
</action>
</package>
</struts>
package liulixin;
import com.opensymphony.xwork2.ActionSupport;
public class test_validate extends ActionSupport {
public String execute(){
return SUCCESS;
}
public void validate(){
System.out.println("auto run");
}
}
haha.jsp has nothing,just "haha" inside the <body>
源代码:http://pan.baidu.com/share/link?shareid=2419188666&uk=3878681452