1、index.jsp
<body> 向结果传参数 <ol> <li><a href="user/user?type=1">传参数</li> </ol> </body>
<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> </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; } }
<body> user Success! <s:property value="r"/><br> <s:property value="#parameters.t"/> <s:debug></s:debug> </body>
原文:http://blog.csdn.net/hoho_12/article/details/50730731