Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Configuration for web application

Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?


author & internet detective
Posts: 40169
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A common solution is a property file. You can place it anywhere on the server and update your classpath to include that directory.
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.
    Bookmark Topic Watch Topic
  • New Topic