I would like to handle request and session attributes myself rather than leaving it to Spring @SessionAttributes, for login or cookies handling for example.
I just cannot figure out how to access the HttpRequest from within a controller. I need a way to go a layer above the @RequestAttribute and access the HttpRequest itself.
With Stripes in used to do this by implementing an ApplicationContext and calling getAttribute().
Also, passing the HttpServletRequest as parameter seems not to work:
@RequestMapping(value="/")
public String home(HttpServletRequest request){
System.out.println(""+request.getSession().getCreationTime());
return "home";
}
Why does this method not print anything?