Struts2 获取session 存入list 到session中

来源:互联网 发布:80端口申请 编辑:程序博客网 时间:2024/04/26 01:20
1、Map<String,Object> map =  ActionContext.getContext().getSession();

2、HttpSession session = ServletActionContext.getRequest().getSession();

获取到session的两种方法

查询到一个集合

List<Category> cList = categoryService.findAll();

将list 存入到session中  到页面获取

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


0 0