`
koudailidexiaolong
  • 浏览: 89926 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

struts重定向传值的方法

 
阅读更多

关于struts中 重定向传参数 我的知道的方法:、

1 保存到session对象中

//使用解耦的方法获得session

ActionContext context = ActionContext.getContext();

Map session = (Map) context.getSession();

//保存你要的数据

session.put(KEY.VALUE);

key为你自己起的别名 通过它去寻找当前的对象

value 为值

2传值的方法

<result name="loadList">list_auditing.jsp</result>

<result name="agree" type="redirectAction">checkResult!loadList?expenseState=${expenseState}</result>

首先你需要出入的参数名必须存在于当前的action中

你要获得的action中也必须有此参数名的存在 意思就是两个action中都要定义你要传的变量

一边传 另一边要有接收的

<wbr></wbr>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics