the "/submit" action actually takes the parameters from "form.jsp" and handles some logic then forward to "result.jsp". So the URL looks like "http://localhost/myapp/submit.do". Now my question is --
In the "result.jsp" how can I get the parameter of "submit.do" ? i.e. how can I find out which "path" was taken before it was forward to current "result.jsp" ? I have tried the following but none of them works --
request.getServletPath(); request.getRequestURI(); request.getRequestURL(); none of them returns "submit.do". so, can I get it and how ?
Hi You want to send user back to his/her initial page? then first of all you need to save your current path in as a session variable or you should use a header variable called Referer request.getHeader("Referer) which will return Referer page. so : in your action retrive the Referer variable , set it as a session variable in the result.jsp you can use that path for what ever you want. if you need more details i would help you