jsp session 创建
程序员文章站
2022-03-01 18:42:44
...
1、 HttpSession session = ServletActionContext.getRequest().getSession(); //创建
2、 ActionContext.getContext().getSession().put("msg", "Hello World from Session!"); //存
session.setAttribute("softtypeid", softtypeid); //存
获取 if(session.getAttribute("softtypeid")!=null){
if(!softtypeid.equals(session.getAttribute("softtypeid")))
pager_offset=1; //如果不是同一种分类,返回是第一页
}
3、
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
HttpSession session = request.getSession(); //创建