Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Tomcat context path via META-INF/context.xml

843841Nov 14 2006 — edited Apr 8 2008
Am incorrectly assuming the use of a context.xml file located withing a war file's META-INF directory for deployment within Tomcat 5.5?

I currently have an extremely simple context.xml file in my war (foo-1.0.war), containing the following:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/foo" />

I was under the impression that when deployed within tomcat, my context path would be set as "/foo". The issue I am having is that the context is still the deployed WAR file's name (/foo-1.0).

I am looking for the easiest path for our operations people to handle deployment. So, I thought I would toss a context.xml file in there (foo-1.0.war#/META-INF/context.xml) and call it a day. I see that the file actually gets extracted and placed into the ${catalina.home}/conf/Catalina/localhost directory, with the name "foo-1.0.xml" (which is where I can see how Tomcat is getting the context name). The contents of the file are exactly what is in the original context.xml file.

So, am I missing a step? Is there another configuration I need to set up to get these context files to be able to declare the context path (wow, that is a lot of "to")?

Thanks,

Briggs.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 6 2008
Added on Nov 14 2006
8 comments
1,799 views