This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes When,  JSP action forward and redirect to be used? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "When,  JSP action forward and redirect to be used?" Watch "When,  JSP action forward and redirect to be used?" New topic
Author

When, JSP action forward and redirect to be used?

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
When, JSP action forward and redirect to be used?
Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
The functionality is same as servlet's forward & redirect
Forward will forward the request & where as redirect will create new request & send it
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
A forward reuses the current request for the new destination. Use it if you want to have access to the initial request.

A redirect lets the client send a brand new request to the server. Use it if you want to get rid of the initial request.
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
A forward reuses the current request for the new destination


Then In the new destination,i can get all parameter of old request???
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Certainly. You have the same instance at your hands.
 
 
subject: When, JSP action forward and redirect to be used?