我想自己处理请求和会话属性,而不是将其留给spring @SessionAttributes,例如登录cookie处理.
我只是无法弄清楚如何HttpRequest在控制器中访问from,我需要一种方法去上面一层@RequestAttribute并访问它HttpRequest自己.使用Stripes来实现ApplicationContext和调用getAttribute().
此外,传递HttpServletRequestas参数似乎不起作用:
@RequestMapping(value="/") public String home(HttpServletRequest request){
System.out.println(""+request.getSession().getCreationTime());
return "home";
}
Run Code Online (Sandbox Code Playgroud)
上述方法不打印任何内容.
你对此有什么建议吗?