• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Defining Params outside of ,war file  RSS feed

Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to define param outside my .war file. I would like to have different values in my param-values depending if the system is running in dev / test or prod.

I am currently defining params in my web.xml file. The web.xml file is compiled into my .war file.

Do you have any ideas on where I can define params outside of my .war file.
Thanks so much, Lisa
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lisa,

The best way is use a properties file(s), which contains all the dev, qa and production related configuration information. Send the jvm arguments from outside to tell which version of configuration you want to use(dev, qa or production). Create a helper class, which reads the configuration file as per jvm arguments and load it in JVM.

But, If you want to keep the properties file from outside the war file, remove it from your WEB-INF/classes directory and keep the properties file in class path(which is not a recommened way of doing it).

Hope it helps!!!

Anil Sadineni.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!