http://blog.csdn.net/is_zhoufeng/article/details/7559756
RequestAttributes ra = RequestContextHolder.getRequestAttributes(); HttpServletRequest request = ((ServletRequestAttributes)ra).getRequest(); request.getSession().setAttribute("sessionMessage", "im'sessionMessage!");
或者
@RequestMapping("/main/login") public String userLogin(String yhdm, HttpSession httpSession, HttpServletRequest request) { httpSession.setAttribute("clientUser", "a"); request.getRemodeAddr(); return "main/framework"; }