I would like to handle request and session attributes myself rather then leave it to spring @SessionAttributes
, for login of cookies handling for example.
I just cant figure out how could I 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 be working:
@RequestMapping(value="/") public String home(HttpServletRequest request){
System.out.println(""+request.getSession().getCreationTime());
return "home";
}
The above method does not print anything.
Do you have any advice on this?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…