| Author |
Query regarding Response.sendRedirect
|
Manish Jaju
Greenhorn
Joined: Jul 21, 2004
Posts: 24
|
|
|
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
Joined: Dec 19, 2002
Posts: 224
|
|
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
Joined: Dec 11, 2004
Posts: 13410
|
|
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 ]
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Ganesh Gowtham
Ranch Hand
Joined: Mar 30, 2005
Posts: 223
|
|
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
|
Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
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.
|
 |
 |
|
|
subject: Query regarding Response.sendRedirect
|
|
|