aspose file tools*
The moose likes Servlets and the fly likes what is the difference between forward and sendredirect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "what is the difference between forward and sendredirect" Watch "what is the difference between forward and sendredirect" New topic
Author

what is the difference between forward and sendredirect

Murthy Cherukumilli
Ranch Hand

Joined: Aug 05, 2004
Posts: 45
what is the difference between forward and sendredirect?


Thanks<br />Murthy (SCJP 1.4 , SCWCD 1.4)
Shankar Narayana
Ranch Hand

Joined: Jan 08, 2003
Posts: 134
Hi,

In brief, forward sends along the request parameters to the new page, whereas sendRedirect doesn't.


"Failure is not when you fall down; its only when you fail to get up again."
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
The important point is that sendRedirect finished the request by sending back a redirect response with a new URL. It is up to the client to interpret that redirect and start a new request.

A forward on the other hand continues processing the request, but by a different servlet or other resource.
Bill
Murthy Cherukumilli
Ranch Hand

Joined: Aug 05, 2004
Posts: 45
thanks you for your input.
 
 
subject: what is the difference between forward and sendredirect