tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nlif <>
Subject How to serve two docBases under the same context path
Date Thu, 23 Oct 2008 14:56:04 GMT

Hi all,

I am using Tomcat 6, and I have the following problem:

I am trying to separate the static content from the dynamic content of my
application. In production, I intend to use Apache to serve the static
content, and Tomcat to process requests to the application (mainly JSP's).
This can be accomplished by writing a deployment script that will copy
everything to its repsective place.

My problem, however, is with the development environment:

The static-content (css,js,images,html) is in one SVN project, and the
dynamic (JSP,WEB-INF,classes) is in another. Thus, on my local workspace,
they are on separate paths (e.g. c:\workspace\static and
c:\workspace\webapp). Now, I need some way to have Tomcat serve them as a
single context.

I thought I'd create two <context> elements in my server.xml file, but they
will need to have the same PATH, like this:

<Context docBase="workspace\static" path="/myapp"/> 
<Context docBase="workspace\webapp" path="/myapp"/>

Unfortunately, it is illegal to have two CONTEXT elements with the same PATH

View this message in context:
Sent from the Tomcat - User mailing list archive at

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message