码迷,mamicode.com
首页 > 其他好文 > 详细

struts2中的session、request 、和action往页面中传值的方法

时间:2016-09-16 00:18:33      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:

 

ActionContext.getContext().put("list", list);

 

ActionContext.getContext().getValueStack().push(listName);//准备回显数据

 

session中放数据:

ActionContext.getContext().getSession().put("user", user);

/** 注销 */
public String logout() throws Exception {
ActionContext.getContext().getSession().remove("user");
return "logout";
}

action中的request:

ServletActionContext.getRequest().getRemoteAddr();//获取IP

 

struts2中的session、request 、和action往页面中传值的方法

标签:

原文地址:http://www.cnblogs.com/qiyc/p/5875693.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!