aspose file tools*
The moose likes Servlets and the fly likes servlet  redirect to html page that called it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet  redirect to html page that called it" Watch "servlet  redirect to html page that called it" New topic
Author

servlet redirect to html page that called it

Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
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
George Pavamani
Ranch Hand

Joined: Jan 31, 2002
Posts: 31
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.
George Carlson
Greenhorn

Joined: Aug 24, 2000
Posts: 15
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet redirect to html page that called it