Hi,

This seems like an obvious question but I'd appreciate any answers. I
have several webapps running under tomcat that need to be able to
include the same sidebar in their .jps.  if the sidebar is within the
context, this works fine:

<%@ include file="sidebar.html" %>

However this requires me to keep a copy of sidebar.html (and all the
images) in each .war.  I'd rather keep a single copy of sidebar.html.
If I make a new context "static" in tomcat and place the sidebar +
images there, I can access it fine in my browser with the url:

http://localhost:8080/static/sidebar.html

but the naive change to the jsp:

<%@ include file="../static/sidebar.html" %>

fails with "the path specifies a resource outside the web
application".  Using jstl and import:

<c:import url="../static/sidebar.html"/>

leads to:

javax.servlet.jsp.JspTagException: /../static/sidebar.html

However, if I use the absolute path:

<c:import url="http://localhost:8080/static/sidebar.html"/>

the page is fine, but because the paths to the images are copied
directly from sidebar.html and included in the .jsp they are
incorrect.

It seems to me that what I'm trying to accomplish is a fairly common
thing; I'd appreciate any pointers.

Thanks,

Martin


--
Martin Jones
Bioinformatics Team
Centres for Cardiovascular Science and Inflammation Research,
University of Edinburgh,
Queen's Medical Research Institute,
47 Little France Crescent
Edinburgh EH16 4TJ
United Kingdom
T: +44 131 242 6700

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to