Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Configuration for web application  RSS feed

 
Bernhard Pauler
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I need to configure my web application. Settings like database connection parameters or log file location.
I don't want to include a configuration file inside my WAR file - I want it to be accessible from outside.

What is the common solution for this problem?

Thanks,

Bernhard
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36396
453
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bernhard,
A common solution is a property file. You can place it anywhere on the server and update your classpath to include that directory.
 
Z Sugiarto
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd second that. Put the system configuration using a .properties file,

you can use ln -s to link your file, and restrict access to the file using simple UNIX permission.

if you want, you can also try something fancy like using a database table to store the configuration (one record per system instance) but I see no reason in NOT using the .properties approach. it's simply effective.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!