Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem due to use of jsp:forward tag

 
Atishay Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if we use jsp:forward tag, it takes the browser to the forarded page. but it does not change the addressbar of the browser with the new webpage address. so when we use series jsp:forward tags and then press the back button of the browser it does take us to the prev page.
how to aviod it.
thanks
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should use sendRedirect method from HttpServletResponse.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is mainly due to the behaviour of forward() and redirect().

For forward(), the request is forwarded to another page, without signaling the browser, thus, it still think that the URL is the forwarded page.

For redirect(), the server sends a signal to browser, ask it to send a request to the forwarded URL on its own, so, the URL changes.

Nick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic