-
Return to previous view after user action (1 messages)
- Posted by: Andrew Birchall
- Posted on: November 20 2009 15:04 EST
Hello, Is there a simple way to return a user to the view (jsp etc.) they were on before they called an action (servlet or struts action), which returns without doing anything? I want the browser to go back to the previous URI before the user called the action so nothing changes, i.e. the view doesn't change and they stay on the same page. This seems like it should be an easy thing to do and I'm probably missing something very obvious but a google search hasn't brought up much that I can see useful. Thanks Andy BThreaded Messages (1)
- Re: Return to previous view after user action by Akin Bolarinwa on December 21 2009 12:03 EST
-
Re: Return to previous view after user action[ Go to top ]
- Posted by: Akin Bolarinwa
- Posted on: December 21 2009 12:03 EST
- in response to Andrew Birchall
Hi Andy B, I saw this question earlier and though you would readily get an answer, but that has not been the case. I will assume that you are talking about returning to the same page after action handling. If that is the case the recipe in Struts is to set the forward to null, as shown in the code snippet below. public ActionForward login (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Perform the needed action // return null will return to or reload the page return null; } Since you mentioned the possibility of other frameworks, you could do the comparison and evaluation with the dWebSpec dictionary site.