This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Is there way to get the url of the page that sent to the request to the current page. I know i can use hidden variables..and things like that, but am wondering if there is a direct way. [ April 18, 2002: Message edited by: Rex Rock ]
String value = request.getParameter("HTTP_REFERRER");
Note however: the referring page name is sent to the server along with the current page request, but the browser is not required to send this information so it is not 100%. The only sure way of getting this information for every request would be to use (as you state) hidden fields or url re-writing.
Yup, request.getHeader("referrer"); Its on the request header. Checkout the example on Tomcat. That will give you an idea. Also, this may not work when you use some of the forward(...) methods. Verify that before you use it. Good luck. - madhav