• 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

server specific config

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have 4 environments, 3 on one box, all have a different domain and host name, currently a servlet contains server specific information, like email, host, db connection and domain name, I would like to move those to a config file. what is the best way to do that in peoples opinion.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Didier McGillis:
I would like to move those to a config file. what is the best way to do that in peoples opinion.



I would put things like that in your deployment descriptor (web.xml) and access them as either context init parameters or as servlet init parameters.
Examples for doing so can be found at http://simple.souther.us

You may also want to look into some of the JNDI Resource capabilities in Tomcat to allow the container to manage things like connection pools and email sessions.
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html
reply
    Bookmark Topic Watch Topic
  • New Topic