jsp redirect problem

Discussion in 'Java' started by bala, Apr 22, 2005.

  1. bala

    bala Guest

    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..
     
    bala, Apr 22, 2005
    #1
    1. Advertising

  2. bala

    Michael Berg Guest

    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
     
    Michael Berg, Apr 22, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,364
    Srowe1975
    Oct 15, 2008
  2. Replies:
    0
    Views:
    4,507
  3. Replies:
    5
    Views:
    516
  4. Sal
    Replies:
    1
    Views:
    1,009
  5. Ron Howard
    Replies:
    2
    Views:
    577
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page