Injecting Properties File Values in CDI Using DeltaSpike and Apache TomEE
Join the DZone community and get the full member experience.
Join For Free
One of the great improvement in Java EE 5 and beyond it is the
introduction of CDI (Context and Dependency Injection). CDI is used for
injecting dependencies among a lot of other things like events,
interceptors, … and can be used in POJOs.
In some cases instead of injecting other objects (as a dependency
injection), you want to inject a value from a properties file into a
class that needs to be configured externally.
I have written an example in Tomitribe community zone: https://github.com/tomitribe/community/tree/master/injecting-properties
We keep learning,
Alex.
CDI
Apache TomEE
Property (programming)
Published at DZone with permission of Alex Soto, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments