开发者

Struts 2: redirect-action ? From on page to another and back again

i have a jsp page that has a submit button. This button is linked with another jsp page.

So lets assume my stuts file looks like this:

B.jsp

So now the submit button being on page "A.jsp" will take me to B.jsp. This works. The problem is that i want to do the following:

press on the submit button on p开发者_StackOverflow社区age A.jsp , go to B.jsp where i will press again a button and go back to A.jsp . The problem is that to page B.jsp go many pages, so B.jsp has to know when pressing the submit button to which page will take me back , in this case A.jsp again.

So in a few words, B.jsp has to know from which page i came from so that i can go back again by pressing a submit button (this could be a parameter that would be sent back to A.jsp again, but does not really matter at the current point)

A.jsp -> B.jsp -> A.jsp C.jsp -> B.jsp -> C.jsp


I guess your B.jsp is some sort of general result page, which displays a message and invites the user to return to the previous page -before the submission. If you dont want to read the browser history with javascript (I woudn't) the standard approach is to pass the "returnUrl" as a property of your Action. This seems straighforward to me.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜