Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   jsp redirect problem (http://www.velocityreviews.com/forums/t142947-jsp-redirect-problem.html)

bala 04-22-2005 07:45 AM

jsp redirect problem
 
i need to redirect a client request to a different URL. So i tried
using Reoponse.sendRedirect(newURL).I want to know if this would
dictate the client to connect to the new URL and the client in turn
connects to the new URL.Also i want this redirect message to be
displayed on my web browser after which the user would manually
connect to the new URL(in IE version 6.0).
Thanks in advance..

Michael Berg 04-22-2005 09:50 PM

Re: jsp redirect problem
 
Hi,

> i need to redirect a client request to a different URL. So i tried
> using Reoponse.sendRedirect(newURL).I want to know if this would
> dictate the client to connect to the new URL and the client in turn


sendRedirect() returns a 304 Object Moved (or variations of that) to the
browser, which then follows the redirection url automatically (no user
intervention required). Note that if you redirect a POST form submission,
you won't get the data passed on to the redirected url automatically. You
need to generate a 307 response in that case (different browsers respond
differently to a 307 redirect - some will raise a confirmation dialog)

> connects to the new URL.Also i want this redirect message to be
> displayed on my web browser after which the user would manually
> connect to the new URL(in IE version 6.0).


If you wish to have this type of behaviour, simply output a page of normal
HTML which shows a nice message to the user, and includes a plain old <a
href... link to the new URL. The user can then click the url. If you want
something to happen automatically after a set time (30 seconds fx) then
output some http-equiv headers with the new url:

<meta http-equiv="refresh" content="30;
URL=www.mysite.com/the/new/url.html">

/Michael
www.hyperpal.com
www.bergconsult.com




All times are GMT. The time now is 08:15 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.