File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Loading Configurable Parameters in a J2EE App Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Loading Configurable Parameters in a J2EE App" Watch "Loading Configurable Parameters in a J2EE App" New topic
Author

Loading Configurable Parameters in a J2EE App

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
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?

3. Use a ResourceBundle?

Which is the preferred way of loading configurable parameters in a J2EE Application?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
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 ...


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loading Configurable Parameters in a J2EE App
 
Similar Threads
Performance impact loadProperties
Suggestion for design change...
Advice sought on managing properties
web application - property file
How to set virtual arguments in servlet