tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roman Sokolyuk <romsok.t...@gmail.com>
Subject Re: Newbie: CSS not taking effect
Date Fri, 31 Jul 2009 15:14:16 GMT
Thank you very much for your time.
This fixed the problem.

I have only one question. How does the browser determine which parts of the
URL to strip?

On Fri, Jul 31, 2009 at 11:07 AM, André Warnier <aw@ice-sa.com> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message