【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"/>

posted @ 2012-02-23 16:19  濤叔  阅读(186)  评论(0编辑  收藏  举报