tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: [BUG]:Relative path is always taken from the server root?
Date Thu, 07 Sep 2000 22:32:37 GMT
Ramesh Mandava wrote:

> Hi:
>   SETUP: TMCAT4.0 ( Catalina 2000/09/05 nightly)
>    If we have any index.html under some Context root(
> eg.JSP11ActPosTests ) and have relative links like
> test1.jsp they are expanded as
> http://servername:port/test1.jsp
> instead of
> http:/<servername>:<port>/<contextroot>/test1.jsp


When you say "relative" link, how are they being expressed?  Your bug
report doesn't give me a precise example of what you are talking about,
so I'm going to describe what I think you're talking about.

Let's assume that you are in a webapp whose context path is "/myapp", and
we are talking about the page at URL


and want to link to menu.jsp in the same web app.

If you use a hyperlink like this:

    <a href="menu.jsp">Menu</a>

It will go to the "menu.jsp" page in the same web application -- it goes


However, if you create your hyperlink like this:

    <a href="/menu.jsp">Menu</a>

this link is interpreted by the *browser* as


because the browser assumes that "/" based paths are resolved from the
server root, not the directory containing the current page.  Note that
the server has nothing at all to do with this.

If this is not what you are seeing, could you please give me a small
actual example (so I can reproduce it) that works in Tomcat 3.x but not
in 4.0?

Craig McClanahan

See you at ApacheCon Europe <>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

View raw message