【Struts2复习知识点十八】 带参数的结果集

在struts.xml中

<result type="redirect">/user_success.jsp?t=${type}</result>
View Code
public class UserAction extends ActionSupport {
private int type;

public int getType() {
return type;
}

public void setType(int type) {
this.type = type;
}

@Override
public String execute() throws Exception {
return "success";
}

}

 <result type="redirect">时 值不能传递过来,但转发可以。

这样在跳转到user_success.jsp中也可以取的type的值。

jsp中用一下标签取值

 <s:property value="t"/> <s:property value="#parameters.t"/>

原文地址:https://www.cnblogs.com/surge/p/2365087.html