To put you in the picture, we're using a custom server based on Tomcat 6.0.29. We're developing using Java and Spring.
Let's say I have a link which takes you from http://localhost/display to http://localhost/save. In the controller of http://localhost/save, can I get http://localhost/display from the request parameter somehow?
request.getRequestURL()
seems to get the url of the current page.
This should give you the referring page (is most cases)
request.getHeader("referer");
See here for details http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14
And here for more details on the request API
You can use "referrer" header to check the page from where the request was made. However it would not work in all cases.
One way could be to set a cookie on http://localhost/display and unset it on http://localhost/save. That way you would know if user visited display prior to save.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With