O'Reilly logo

Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications by Mick Knutson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Java EE configuration with CDI

The easiest approach to externalizing configuration within your application is to use property files to store key value pairs that are imported on start up for the application. This solution is fairly simple to implement and allows for simple properties to be set.

One of the major drawbacks to this solution is the need to stop and start the server in the event a property needs to be changed before it can be used in a running application. Another drawback to this situation is the flat nature of properties.

Property files do not allow for nested property collections or data types other than Strings. Most teams that start with this approach create wrapper classes that convert Strings to other datatypes, and in some ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required