Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet redirect to html page that called it

 
Peter Straw
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic