struts2 中ActionContext.getContext().getSession().put("",和HttpSession有什么区别吗

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/13 06:48:26

struts2 中ActionContext.getContext().getSession().put("",和HttpSession有什么区别吗
struts2 中ActionContext.getContext().getSession().put("",和HttpSession有什么区别吗

struts2 中ActionContext.getContext().getSession().put("",和HttpSession有什么区别吗
没区别,前一个是将值保存到session中,效果等同于session.setAttribute("",""),前者就是struts2对后者的一个封装,把session,request,application全都放到了actioncontext()容器中了.