tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Newbie: CSS not taking effect
Date Fri, 31 Jul 2009 15:07:01 GMT
Roman Sokolyuk wrote:

> header2.jsp
> ------------------
>         <link href="../../CSS/style1.css" rel="stylesheet" type="text/css"/>
> The CSS directory is under the app context, alongside WEB-INF.
> Am I specifying the path to the CSS correctly? Anyone can suggest what else
> I may be doing wrong?

I am not a JSP specialist, but I would guess that your problem is indeed 
with the above.

You have to think from the point of view of /the browser/, because it is 
the browser who will interpret this, relatively to where /it/ thinks it 
has got the original page from.

In other words, suppose that the user's browser originally gets this 
page from a link like :

Then, to obtain the above stylesheet, the browser is going to :
- strip the ? and whatever is after it (if anything)
- strip the last element of the path (somedir), leaving
- add the relative reference (../../CSS/style1.css) to that, resulting in

Now, does that point to the right place on the server ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message