java学习

java学习

 

struts2重定向到jsp传值

 <a href="hello?name=1">重定向传参数</a>
<package name="default" namespace="/" extends="struts-default">
 <default-action-ref name="hello"></default-action-ref>
  <action name="hello" class="UserAction">   
   <result type="redirect">/index2.jsp?t=${name}</result>
  </action>
 </package>

 

public class UserAction extends ActionSupport{

 /**
  *
  */
 private static final long serialVersionUID = 1L;
 private String name;
 @Override
 public String execute() throws Exception {
  System.out.println(name);
  return ActionSupport.SUCCESS;
  
 }
 public String getName() {
  return name;
 }
 public void setName(String name) {
  this.name = name;
 }

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

posted on 2013-04-14 21:11 杨军威 阅读(690) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜