On 24/08/2010 18:14, Jason Britton wrote:
> I'm trying to configure a tomcat context that I could deploy the classes,
> libs, web.xml using a .war file but the actual jsp's, html, web content
> would not be packed up in the .war file and would live in a directory
> outside of the exploded war directory.  I need to be able to redeploy my
> classes/libs/web.xml without removing/redeploying the web content
> (html/jsp's).  I would rather not have to hand copy class
> file/lib/configuration changes into my context WEB-INF directory but right
> now that seems as my only option if I do not want to rely on having my web
> content bundled into my .war.  I have tried modifying my context's docBase
> to point outside of the host's appBase but that did not have desired effect
> as it changed the location of where my WEB-INF directory and web-content
> needed to go, when I really want to separate the location of the
> configuration,libs,classes of my context from the web content.
> 
> I'm running tomcat 6.0.29 on 64 bit RHEL 5.  Apache 2.2.16 sits infront of
> tomcat.  Any advice or kicks in the right direction would be greatly
> appreciated.

The short answer is: you can't separate the components of a webapp out
into separate locations.


Longer answer:

JSPs get compiled into Servlets, which then deliver the response for
requests which match the path of the JSP.  The Servlets are classes.  If
you precompile the application, they'll need to be in WEB-INF/classes,
if you don't they'll live in a tomcat/work subdirectory.

The container delegates a request to a web application with a matching
path prefix.  Unmatched requests go to the default application, 'ROOT'.

Thusly, each webapp must know how to deliver resources for the requests
it receives.  Webapps are supposed to be self-contained.

You can, of course, deploy separate apps for different paths, perhaps
placing all images in separate app called (surprisingly) '/images'.

Your intended strategy is counter to how to a Servlet container is
supposed to work, so if you're going to have a constant struggle trying
to make it work any other way.  Cut your losses now & try to work with
the container.


p

Attachment: 0x62590808.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to