• Post Reply Bookmark Topic Watch Topic
  • New Topic

Defining Params outside of ,war file

 
Lisa Zapson
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
 
Anil Sadi
Greenhorn
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!