aspose file tools*
The moose likes Tomcat and the fly likes needs help: context -entry in server.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "needs help: context -entry in server.xml" Watch "needs help: context -entry in server.xml" New topic
Author

needs help: context -entry in server.xml

P Hunter
Greenhorn

Joined: Sep 26, 2007
Posts: 3
hi everyone,

i know that entries in the server.xml are discouraged but it's exactly what I need for the case.

Following Problem:

I have a parameter-node in the context node of my server.xml that acts as a environment-determinator that a webapp uses to know in which environment it is and which configuration to load:

The problem is that tomcat reports that it can't find that directory if the webapp is not yet deployed (obviously). I want to deploy with maven so tomcat and its manager has to run before deployment.

How do I tell tomcat to load that parameter so the webapp can access it without setting a path? It can be global and accessible by other apps. I specifically don't want it in the webapp.
I tried setting the path to "/" but then the webapp can't find the parameter in the context with

thanks for help
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
What version of Tomcat are you using? You could move the <Context> element into /META-INF/context.xml as it is.

If I misunderstood your question, please ignore this.
P Hunter
Greenhorn

Joined: Sep 26, 2007
Posts: 3
i use version 6.
I don't want the parameter to be specific to the application. That is why i added it to the server.xml and not in the web-app's context.xml unter Meta-Inf.
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
Could this be what you need: http://tomcat.apache.org/tomcat-6.0-doc/config/globalresources.html?
P Hunter
Greenhorn

Joined: Sep 26, 2007
Posts: 3
this helps A LOT !

http://forum.java.sun.com/thread.jspa?threadID=647327&messageID=3810991


thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: needs help: context -entry in server.xml