Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query regarding Response.sendRedirect

 
Manish Jaju
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
During response.sendRedirect, How client comes to know that it has to again make a new request. How that Information is sent to client(for making a new request). Can anybody clarify this.
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the job of the developer to re-direct the browser to the new location.

At most, you can provide a link on the page where the client can click if the page doesn't get displayed automatically in, say, a few seconds.

Regards,
Saket
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you call sendRedirect the server sends two header variables that tell the client's browser what to do:

The first is a 302 (Moved Temporarily) status code.
The other is the "Location" value containing the page to which the browser is to be redirected.


[ April 11, 2005: Message edited by: Ben Souther ]
 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have a doubt when the user use SendRedirect(...newPage.jsp);
will the newPage.jsp will contain the data in req
Let me know the funtionality......
i mean data that we store in req while travesing the pages...

say if u have 4 pages while

page 1 ---> page2 ---> page3
due to some problem u are redirecting the client req so that req goes to new page...
while crawling the page1 thru page 3 if store data in req will i get in transfeed page
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, with sendRedirect, each page will have a new request object.
If you want to retain your objects across requests, you would need to bind them to session scope.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic