开发者

Spring redirecting back to referrer

I have some resources in my application that require redirection to another resource (form) if some context information is not set. After the context gets set (requires two user steps), I need to redirect back to the requested resource. How do I achieve that. I am using annotation based controllers in Spring 3. 开发者_如何学GoIs org.springframework.security.web.savedrequest.HttpSessionRequestCache of any use.


you can of course do that kind of logic yourself in your controllers. Register a custom sesssion object, query the session object for an object that must be there in order to fulfill the condition. If the condition is fulfilled, show view a, otherwise show view b.

this kind of behavior will normally reside in an aspect of some sort, e.g. in a servlet interceptor

But I believe the best solution would be to use spring web flow http://www.springsource.org/webflow (although I have not tried it yet)


Pass the location of the resource along on each page, as a hidden field.

Using the session to store it has one major drawback - if the user opens two tabs with different resources, one will be lost.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜