JavaWeb创建session

来源:互联网 发布:linux配置文件目录 编辑:程序博客网 时间:2024/04/29 21:52
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(); //创建


0 0
原创粉丝点击