Govind Seshadri wrote:
> The Servlet 2.1 API unequivocally states that relative URLs are not
> permitted with response.sendRedirect(). See the following API link:
>
>http://java.sun.com/products/servlet/2.1/api/javax.servlet.http.HttpServletResponse.html#sendRedirect(javax.servlet.http.String)
>
> But you know what? You are right! It seems you can indeed use relative
> URLs with sendRedirect(). I am now not sure whether this is a bug or an
> unintended 'feature'... :->
>
In spite of what the specs say, some servlet engines converted relative->absolute for
you, and some browsers even know how to do a
relative sendRedirect in spite of what the HTTP protocol specs say (absolute), so it
sometimes worked even when the servlet engine
did not do anything.
The version 2.2 API recognizes this reality and will say that relative URLs are
allowed, but it requires the servlet engine to
produce an absolute one to send back to the browser, in conformance with HTTP.
>
> I have appropriately modified the FAQ entry. Thanks for pointing it out.
>
> Govind
>
Craig McClanahan
>
> Khurram Mahmood wrote:
> >
> > I think jguru is wrong about this one. I have been using sendRedirect() with
> > relative URL's and it works fine.
> >
> > KM
> >
> > -----Original Message-----
> > From: Govind Seshadri [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, December 02, 1999 12:06 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: AW: Redirection to another page
> >
> > The response.sendRedirect() accepts only a fully qualified URL.
> > For handling relative URLs see the following jGuru JSP FAQ entry:
> >
> > http://www.jguru.com/jguru/faq/view.jsp?EID=376
> >
> > hth,
> > Govind
> >
> > "Bernard, Frank" wrote:
> > >
> > > > Is it possible to write JSP code to redirect the browser to open a new
> > > > page,
> > > > say, page B from JSP code in page A?
> > > >
> > > use: response.sendRedirect ( target_URL );
> > >
> > > Frank Bernard
> > > Healy Hudson AG
> > > CDT - Core Development Team
> > > 67691 Hochspeyer, Nelkenstr. 43
> > > Tel.: 06305 / 92 11-804, Fax: 06305 / 92 11-60
> > >
> > >
> > ===========================================================================
> > > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > > FAQs on JSP can be found at:
> > > http://java.sun.com/products/jsp/faq.html
> > > http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> > --
> > Govind Seshadri <[EMAIL PROTECTED]>
> > Enterprise Java Guru
> > jGuru.com - The Java Portal
> > http://www.jguru.com
> >
> > ===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > FAQs on JSP can be found at:
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
>
> --
> Govind Seshadri <[EMAIL PROTECTED]>
> Enterprise Java Guru
> jGuru.com - The Java Portal
> http://www.jguru.com
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html