Wednesday Apr 09, 2014

Method Validation in Bean Validation 1.1

Although it's a point release Bean Validation 1.1 brings a number of important features to Java EE 7. Easily the most important such feature is method validation. Beyond helping enforce design-by-contract in key service layer API classes (typically implemented in EJB3 or CDI) method validation plays an important role in helping ensure valid input to remote client endpoins written in JAX-RS and WebSocket. Hardy Ferentschik of the JBoss community explains the feature well. There's also the 15-minute Bean Validation 1.1 presentation by specification lead Emmanuel Bernard on the GlassFish videos YouTube channel as well the slide deck for my own lighting talk:

If you are interested in how method validation might be used in a realistic scenario with JAX-RS and WebSocket, feel free to dig into my example application on GitHub demostrating how Java EE 7 can be used with JavaScript MV* frameworks (in this case AngularJS).

Thursday Sep 19, 2013

CDI Alignment in Bean Validation 1.1

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.

Monday Aug 12, 2013

Using EL in Constraint Violation Messages with Bean Validation 1.1

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 useful feature is the ability to customize constraint violation messages using EL. Gunnar Morling does a great job of explaining the feature in a recent blog 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 newly released Java EE 7 SDK.