tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
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 :
http://somehost/myapp/somedir?somequery

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
http://somehost/myapp/
- add the relative reference (../../CSS/style1.css) to that, resulting in
http://somehost/myapp/../../CSS/style1.css

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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message