result 带参数

来源:互联网 发布:windows 10 安装失败 编辑:程序博客网 时间:2024/05/03 23:09

public class test1 extends ActionSupport{private int type;public int getType() {return type;}public void setType(int type) {this.type = type;}public String execute(){return SUCCESS;}}


 

xml

<struts>    <constant name="struts.devMode" value="true" />    <constant name="struts.i18n.encoding" value="GBK" />    <package name="test1" extends="struts-default" namespace="/having">    <action name="normal" class="com.sl.having.test1">    <result type="redirect">/r1.jsp?t=${type}</result>    </action>    </package></struts>


 

输入http://localhost:8080/struts2_2/having/normal?type=5 传过去
原创粉丝点击