Reza Rahman is a former independent consultant, now Java EE/GlassFish evangelist at Oracle. He is the author of the popular book EJB 3 in Action. Reza is a frequent speaker at Java User Groups and conferences worldwide. Reza has been a member of the Java EE, EJB and JMS expert groups. He implemented the EJB container for the Resin open source Java EE application server. All views voiced are my own, not necessarily Oracle's. Reza is a DZone MVB and is not an employee of DZone and has posted 184 posts at DZone. You can read more from them at their website. View Full User Profile

CDI Alignment in Bean Validation 1.1

09.25.2013
| 2269 views |
  • submit to reddit

Although it's a point release Bean Validation 1.1 brings a number of important features to Java EE 7. While the most significant of these features is clearly method validation, another very important feature is further alignment with CDI. In Java EE 6 there were a few corner cases left were Bean Validation did not work well with CDI. The most prominent of these gaps was the inability to do injection into custom constraint validators. Projects like Apache CODI and Seam 3 stepped in to fill these gaps. In Java EE 7/Bean Validation 1.1 this issue was properly addressed by making all bean validation artifacts injection officially capable. Romain Manni-Bucau of the Apache TomEE community explains the feature well in a code driven post. There's also the 15-minute Bean Validation 1.1 presentation by specification lead Emmanuel Bernard on the GlassFish videos YouTube channel:

You can also check out the very well written official specification or try things out with the Java EE 7 SDK.

Published at DZone with permission of Reza Rahman, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)