1、index.jsp
向結果傳參數
<struts>
<constant name="struts.devMode" value="true">
<package name="user" namespace="/user" extends="struts-default">
<action name="user" class="com.wxh.action.UserAction">
<result type="redirect">/userSuccess.jsp?t=${type}</result>
</action>
</package>
</constant></struts>
package com.wxh.action;
import com.opensymphony.xwork2.ActionSupport;
public class UserAction extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = 1L;
private int type;
public String execute() throws Exception{
return "success";
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
4、userSuccess.jsp
user Success!