-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

André,

On 9/19/2011 6:06 PM, André Warnier wrote:
> What I do not understand here (maybe due to my lack of knowledge of
> JSP pages logic) is why one would need to "fix" anything, if the
> links are correctly spelled-out in the first place, taking into
> account how a browser handles absolute/relative links.
> 
> e.g. imagine this structure :
> 
> (catalina_base)/webapps/ myapp/ (contains *.JSP pages) /images/
> (contains images) /css/ (contains stylesheets)
> 
> If the JSP pages contain links to stylesheets located in
> "myapp/css", their reference should say : href(or
> src)="css/name-of-stylesheet.css"

You can't do this unless all your JSPs are at the same directory
level, say, in "myapp".

> If the css files in turn contain links to images, they can be
> expressed as : src="../images/some-image.jpg" And so on.

This doesn't work if there are JSPs included in others from various
levels in the directory tree. It works great when the world is flat...
after that, everything goes to hell.

> If you then move "en block" the whole "myapp" somewhere else, all
> links should keep working just fine.
> 
> Or does something there not work in a webapp/JSP context ?

That will work in a JSP context... it's just that the recommended
technique is to use "relative-absolute" (a term I just made-up: a URI
starting with a '/') URI to reference everything. With dynamic
includes, etc. it's very easy to get relative links all confused and
nothing works.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk54tFMACgkQ9CaO5/Lv0PBTdQCeIpr6LNVplO0Nbw07rRevjqud
J2wAoL/zIoICL7fx0vinP6AksKFCVBYg
=VcjM
-----END PGP SIGNATURE-----

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

Reply via email to