Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Injecting Properties File Values in CDI Using DeltaSpike and Apache TomEE

DZone's Guide to

Injecting Properties File Values in CDI Using DeltaSpike and Apache TomEE

· Integration Zone
Free Resource

Share, secure, distribute, control, and monetize your APIs with the platform built with performance, time-to-value, and growth in mind. Free 90-day trial of 3Scale by Red Hat

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.

Explore the core elements of owning an API strategy and best practices for effective API programs. Download the API Owner's Manual, brought to you by 3Scale by Red Hat

Topics:

Published at DZone with permission of Alex Soto, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}