File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes send redirect method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "send redirect method" Watch "send redirect method" New topic

send redirect method

praveen kumar gowda

Joined: Feb 20, 2012
Posts: 23
hello..every one..this is my first...doubts that i am putting here..please do help..

difference between send redirect and forward()...

in which case we can see the help of send redirect()....

so far what i understood about send redirect is, it sends a header back to the client/browser. this header then contains the resource(page/servlet) which you wanted to be redirected.

i want to kw what user might requested ...what the send redirect saying...please help me out for this confusion...
Joemon Anthony

Joined: May 22, 2011
Posts: 26

Please go through this url click here

(SCJP 5, OCA 9i)
(Always interested in learning)
Pete Nelson
Ranch Hand

Joined: Aug 30, 2010
Posts: 147

A redirect is part of the HTTP spec, and takes place at the client. Basically, the server sends a "Location: http://some.url/somewhere", and the browser should follow that new URL.

A "forward" or "include" is internal to your servlet environment, and basically allows one program unit (JSP, Servlet) to forward to or include another before sending the final output to the browser.

In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
sendredirect taks place at the client side whereas forward takes place at the server side.
I agree. Here's the link:
subject: send redirect method
jQuery in Action, 3rd edition