tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giorgio Ponza <>
Subject Re: Bug in c:url taglib
Date Thu, 13 Jul 2006 07:16:18 GMT
Hi Martyn
This is not a bug but a "feature". Infact when you specify an absolute 
path for the "value" attribute, the JSTL will prepend it with the 
"context" of the web-app. In your case, i think you have a context with 
path "/" in your server.xml (or context.xml etc)

 From the spec, section 7.5:

   The URL must be either an absolute URL starting with a scheme
   (e.g. "http:// server/context/page.jsp") or a relative URL as
   defined by JSP 1.2 in JSP.2.2.1 "Relative URL Specification". As a
   consequence, an implementation must prepend the context path to a
   URL that starts with a slash (e.g. "/page2.jsp") so that such URLs
   can be properly interpreted by a client browser.

You should use relative paths to avoid it :D

Giorgio Ponza

Martyn Hiemstra wrote:
> Hi All
> I am having a problem with Tomcat 5.0.28. I designed a website a few 
> months ago and I started working on it again. I cant remember what 
> version Tomcat I designed it in but now I'm trying Tomcat 5.0.28.
> When I deploy my website everything deploys perfectly. When i view the 
> page it's white as if there is no style. I then viewed the source and I 
> saw this:
>    <link rel="stylesheet" href="//displayThemeCss" type="text/css" />
>    <link rel="stylesheet" href="//displayModuleCss" type="text/css" />
>    <link rel="stylesheet" href="//displaySystemModulesCss" 
> type="text/css" />
>    <link rel="stylesheet" href="//core/css/common.css" type="text/css" />
> The source code in my jsp file is this:
>        <link rel="stylesheet" href="<c:url value="/displayThemeCss" />" 
> type="text/css" />
>        <link rel="stylesheet" href="<c:url value="/displayModuleCss" />" 
> type="text/css" />
>        <link rel="stylesheet" href="<c:url 
> value="/displaySystemModulesCss" />" type="text/css" />
>        <link rel="stylesheet" href="<c:url value="/core/css/common.css" 
> />" type="text/css" />
> As you can see the c:url tag messes up the url by adding 2 forward 
> slahes. This makes the browser think that it shoulod load the style 
> sheets from the server displayThemeCss, displayModuleCss etc
> I beleive this to be a bug in the class that formats the url. Does 
> anybody know how to solve this.
> Thanks in advance,
> Martyn
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message