tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Question on Contexts and resource pathing
Date Tue, 02 Oct 2012 20:17:53 GMT
> From: Josh Gooding [mailto:josh.gooding@gmail.com] 
> Subject: Question on Contexts and resource pathing

> when the application is zipped up and deployed out under 
> $CATALINA_HOME/webapps/ROOT

For clarification, do you mean deployed _as_ ROOT, or _under_ ROOT?  Webapps cannot be nested,
so no webapp should be deployed _under_ another.

> I should be able to build the war to any name I want and still have all of
> the links work, even if they are referenced like:

> <link rel="stylesheet" type="text/css" href="/default.css" /> NOT ~> <link
> rel="stylesheet" type="text/css"
> href="${pageContext.request.getContext}/default.css" /> or ../default.css

Remember that relative links are based on the web page the links are accessed from, not to
the base of the webapp.  You need to use a leading slash to base them on the webapp.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


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


Mime
View raw message