1.通过ServletActionContext获取Servlet api方式
2.获取HttpServletRequest
request = ServletActionContext.getRequest();
3.获取HttpServletResponse
response = ServletActionContext.getResponse();
4.获取HttpSession
httpSession = ServletActionContext.getRequest().getSession();
5.获取ServletContext
servletContext = ServletActionContext.getServletContext();
6.获取Map<String,Object> session
session = ServletActionContext.getContext().getSession();
本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1563144