Hi, Is it possible for a servlet to get the name of the html page that called it? - even if the html page is on a different box? We have a situation where one servlet is used for database input by many html pages and it would be nice if the servlet could return the user to the same page where they started. Many thanks
Joined: Jan 31, 2002
If i were you, I would either go for URL Rewriting or Hidden fields(if the html pages are form). Attach a value to the URL ( or hidden field) that would help in uniquely identifying the html page. I hope this helps.
Joined: Aug 24, 2000
A much simpler way to get the name of the html page that called the servlet is to use the request.getHeader("referrer") method. This will work unless you are calling it from an https page in which it is a lot harder.