• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

needs help: context -entry in server.xml

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could this be what you need: http://tomcat.apache.org/tomcat-6.0-doc/config/globalresources.html?
 
P Hunter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this helps A LOT !

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


thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic