I have a Web Application calling 3rd party Web Services. This application needs a number of configurable parameters.
For eg: Java.util.logging parameters, Web Services URLs and other parameters. Which is the best place to store them as configurable parameters?
1. I can store them in my Web.xml and retrieve them in the Servlet, but I might have to redeploy my application everytime, one of the parameters changes.
2. I can store them in a properties file, say, ABC.properties, using a static class or a Singleton to a access the properties. But is it OK to read configurable properties in this way from a J2EE application?
Which is the preferred way of loading configurable parameters in a J2EE Application?
posted 11 years ago
It all depends on the requirements for your application. If you truly need your application to be running all the time and can't spare a few minutes for a redeploy, then most of those solutions wouldn't be viable. Possibly a database if you're looking for 24x7 availability. How often are these values changing? What are your availability requirements? Etc ...