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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Configuration for web application

 
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
 
author & internet detective
Posts: 40169
812
Eclipse IDE VI Editor Java
  • 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.
 
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