tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: WAR future-compatibility
Date Fri, 10 Jan 2003 19:59:05 GMT


On Fri, 10 Jan 2003, Erik Price wrote:

> Date: Fri, 10 Jan 2003 12:16:46 -0500
> From: Erik Price <eprice@ptc.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: WAR future-compatibility
>
> I have learned, thanks to reading this list, that one cannot depend on
> the presence of the filesystem when developing a webapp, if that webapp
> is ever to be bundled as a WAR file.
>
> I would like to structure my webapp thusly:
>
> /webapp
>    |
>    jsp1.jsp
>    jsp2.jsp
>    jsp3.jsp
>    /includes     <-- this is "/webapp/includes"
>      |
>      titlebar.jsp
>      navbar.jsp
>      footer.jsp
>    /WEB-INF
>      |
>      /classes
>      /lib
>
> If I do this:
>
> <%@ include file="includes/titlebar.jsp" %>
>
> Will my webapp still work if it's bundled as a WAR file?  Or is this a
> case of creating a dependency on the presence of the filesystem?
>

This will work fine.  Containers that run webapps directly from a WAR know
how to resolve relative URIs to other resources in the WAR.

You can even try it for yourself if you want -- set the umpackWARs
attribute in server.xml to false, and put a WAR file into the webapps
directory.

>
> Thanks,
>
> Erik

Craig


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message