Craig,

Forwards and redirects not withstanding, is it a fair statement to conclude
that all links (hrefs, image srcs, etc.) in a web application must be
rendered in a relative manner?

There isn't any talk of making <img src="/images/a.gif"> relative to a
context is there?

jim


> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 11, 2001 7:14 PM
> To: [EMAIL PROTECTED]
> Subject: Re: The use of '..' in relative path includes in JSPs
>
>
>
>
> On Sun, 11 Mar 2001, Arch Pennington wrote:
>
> > Are Servlet 2.2/JSP 1.1 compatible containers
> > *required* to support
> > relative paths that use the '..' notation to refer to
> > a parent
> > directory?  JRun 3.0, iPlanet 4.1 and Tomcat 3.2.1
> > seem to accept '..'
> > in a relative path for static includes of JSP pages,
> > but not for
> > dynamic includes (all includes were from a JSP page
> > with no mappings
> > defined for them in web.xml).
> >
>
> If by "dynamic includes" you mean <jsp:include>, the path is required to
> start with a slash, and is interpreted relative to the context root of
> your web application.  The same restriction applies to <jsp:forward>, and
> to the corresponding RequestDispatcher constructs in the servlet world.
>
> The basic idea of using context relative paths is that you should be able
> to deploy your web application on *any* context path, and it should still
> work.
>
> > The JSP 1.1 specification (Section 2.5.2) delegates
> > the definition of
> > relative paths to RFC 2396.  According to RFC 2396
> > (Section 5 and
> > Appendix C), relative paths should be allowed.
> >
> > JSP 1.1 Spec:
> > http://java.sun.com/products/jsp/download.html
> > RFC 2396 Spec: http://www.faqs.org/rfcs/rfc2396.html
> >
>
> Support for ".." depends on exactly where you are trying to use it.  For
> example, you will not be allowed to use "../../../" type paths to access a
> static resource "above" the context root of your own web application.
>
> Do you have a specific example of something you want to do that is not
> working for you?
>
> Craig
>
>

Reply via email to