开发者

Web page navigation

I'm looking for guidelines for how to best implement web page navigation logic for a Spring based web application. For example: I have a web page 'C' where if I click ok, I want flow to return to page 'A' if that was the previous page, or page 'B' if that was the previous page. I am currently using hidden fields on a page to track from which page I arrived...开发者_Go百科but I think there must be a better way...


You can use flash scope bean for saving the view Url from which you are redirected.

You can read about flash scope from this page:

http://blog.smartkey.co.uk/2011/01/implementing-flash-scope-in-java-web-applications/

See me response from this post. it Explains how to implement Flash Scope in SPring MVC environment.

Spring MVC custom scope bean

with this scope you can alway retrieve the URL form which you will redirected and then build link form the value retrieved.

Hope it helps.


My suggestion would be to use Spring Web Flow (http://www.springsource.org/webflow).

It's intended to do exactly what you want. Control the flows between pages.

I start using it a couple of month ago and I love it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜