• Post Reply Bookmark Topic Watch Topic
  • New Topic

response and send redirect  RSS feed

 
Deepa Jeeva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..can anyone tel me the internal worflow that happens when we specify forward or send redirect?This was an interview question posed to me..
 
Ganesan Ramakrishnan
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

forward : It's using the same request, ie you can get the other pages parametes.
its happening in server side.

send redirect : its creating the new request, so you cant get the other pages parameters.
its happening in client side.

i hope this will help you.

Regards
Ganesan
 
Jack clouseau
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i suppose this would be helpful for you...
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Deepa Jeeva:
Hi..can anyone tel me the internal worflow that happens when we specify forward or send redirect?This was an interview question posed to me..


Forward is simply forwarding the stuff to someone else...done by the server.

Redirect is the server asks the client to request for a new page or resource whatever you specify.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be more specific about a redirect, the server returns a 30x status code which tell the browser that this resource has moved, either permanently, or temporarily, depending on the last digit. It also sends a "Location" header containing the URL for the new location of this resource. The browser takes this information and generates a new request for the new URL.

Forwards, as mentioned earlier, simply pass the entire request, response to another resource on the server and leave it up to that resource to generate the response. In this case, the client (browser) has no knowledge of any of this. It asks for A, gets B, and has no idea that the switch was made on the server.
 
Deepa Jeeva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, thanks for the response.Now I have got a clear idea of it.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
To be more specific about a redirect, the server returns a 30x status code which tell the browser that this resource has moved, either permanently, or temporarily, depending on the last digit. It also sends a "Location" header containing the URL for the new location of this resource. The browser takes this information and generates a new request for the new URL.

Forwards, as mentioned earlier, simply pass the entire request, response to another resource on the server and leave it up to that resource to generate the response. In this case, the client (browser) has no knowledge of any of this. It asks for A, gets B, and has no idea that the switch was made on the server.


Good one!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!