Springmvc:

RequestAttributes ra = RequestContextHolder.getRequestAttributes();
HttpServletRequest request = ((ServletRequestAttributes)ra).getRequest();
request.getSession().setAttribute("sessionMessage", "im'sessionMessage!");
属性设置也可以使用putValue(已弃用),和setAttribute一样; HttpSession session=request.getSession();

Struts2:

Map<String,Object> session=ActionContext.getContext.getSession();
session.put(Constant.SESSION_USER_KEY,userVO);
05-21 22:04