• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

sendRedirect - to what Path? example code enclosed!

Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a continuation of the discussion from the other threads (started by faiza) re the path issues. Stating them in seperate threads so that we can discuss them without crossing lines with other methods.....
The sendRedirect method of HttpResponse object takes a string argument which represents a URLpath. This URLpath can be:
  • relative to the current ServletContext starting with a "/".
  • relative to the current ServletRequest starting with a name of the servlet/jsp, not starting with a "/".
  • an absolute path starting with http://....
  • can point to an absolute URL outside the scope of the current ServletContext or the current Server. See example code.

  • Any output (response) added to the response
    object before the redirect is cleared and the
    content of the redirected page is returned to
    the client. If the buffer is committed to the
    client before the redirect, the container should
    throw a IllegalStateException.
    Any content added to the response after the
    redirect is ignored by the container.
    The foll. code made me come to these conclusions...

    - satya
    [ February 03, 2002: Message edited by: Madhav Lakkapragada ]
    Ranch Hand
    Posts: 173
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Yup everything works!!!
    I am not young enough to know everything. - Oscar Wilde This tiny ad thinks it knows more than Oscar:
    Thread Boost feature
      Bookmark Topic Watch Topic
    • New Topic