aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes sendRedirect()  happens at client side or at the server side Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "sendRedirect()  happens at client side or at the server side" Watch "sendRedirect()  happens at client side or at the server side" New topic
Author

sendRedirect() happens at client side or at the server side

Sony Agrawal
Ranch Hand

Joined: Oct 04, 2009
Posts: 143
HFSJ wrote:A request dispatch happens on the server, while a redirect happens on the client

Isn't both the methods used in the servlet? Then both should happen at server side right?
Or did i misunderstood what is client/server side?
avi sinha
Ranch Hand

Joined: Mar 15, 2009
Posts: 453

sony agrwal wrote:
HFSJ wrote:A request dispatch happens on the server, while a redirect happens on the client

Isn't both the methods used in the servlet? Then both should happen at server side right?
Or did i misunderstood what is client/server side?


i think yes you have misunderstood it.by client side or server side you can think here as the entity who is doing the job of redirection.

RequestDispatcher is done by the server. its the server who dispatches the request and response object to the specified url or address.
sendRedirect compels the browser to send a new request to the url specified in the redirect. hence it is done on the client side.

also you can check the final url in the browser. if it is done on the server side the url will be the same but in case of client side it will be different.

avi sinha


SCJP 5.0 SCWCD 5.0
Sony Agrawal
Ranch Hand

Joined: Oct 04, 2009
Posts: 143
avi sinha wrote: the entity who is doing the job of redirection.

I think this cleared my doubt
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9313
    
  17

This question is in the FAQ here...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sendRedirect() happens at client side or at the server side