2012-05-21 43 views
4

我的例子是如何在Spring Security 3.1.1中获得SavedRequest?

SavedRequest savedRequest = (SavedRequest) httpRequest.getSession() 
     .getAttribute(AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY); 

但这并不在SpringSecurity 3.1.1

+0

我还没有尝试过工作,但:http://stackoverflow.com/a/5389357/322166 – Dani

+0

感谢您的答复。我无法找到属性键“WebAttributes.SAVED_REQUEST” – xavierzhao

+0

但您不需要该属性,我认为,您只需要在HttpSessionRequestCache上调用getRequest方法:'new HttpSessionRequestCache()。getRequest(请求,响应)' – Dani

回答

1
SavedRequest savedRequest = (SavedRequest)httpRequest.getSession().getAttribute(AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY); 
相关问题