Additionally, does it follow that <img> elements have to refer to images
located outside the WEB-INF directory (Since no content from WEB-INF can be
served directly to the browser request)? Is there a way to use CSS and
images from within WEB-INf so that a client wouldn't be able to get to them
on its own?

On Fri, Jul 31, 2009 at 11:14 AM, Roman Sokolyuk <romsok.t...@gmail.com>wrote:

> 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 <a...@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-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>

Reply via email to