Two Laptop Bag*
The moose likes Servlets and the fly likes does URL content change when I use .forward() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "does URL content change when I use .forward()" Watch "does URL content change when I use .forward()" New topic
Author

does URL content change when I use .forward()

Ian Yang
Ranch Hand

Joined: Nov 27, 2001
Posts: 44
Hello,
I found that when I do a forward(req, res) from a servlet to a jsp. The content of the page changes to the jsp's content, but the URL stays the same as servlet's URL. Is it suppose to be the case ?
Thank lot,
Ian
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
yes. it is
if u want to send the client browser to a new url completly use the response.sendRedirect(..)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: does URL content change when I use .forward()