Over a million developers have joined DZone.

iScreen 2.0.0: Reporting Validation Failures


iScreen is a Java object validation framework, which means it is designed to validate full object-graphs. Based upon a powerful and flexible XML configuration, developers concentrate on configuring their validations, rather than coding them.

This new release adds several new features related to reporting validation failures. Failures can now have arbitrary severity levels, multiple failure messages, and a better tracing capability. A new conditional was added to individual validator use, which means that you can use logic to determine whether to execute a validator or not. Both OGNL and MVEL are supported expressions languages.

Here's an example of using the new 'if' attribute on the 'use-validator' element, and multiple messages associated with a failure (as well as defining a severity level on a failure).

<validation-set id="validateMyObject">


<use-validator ref="MyStringValidator" if="bean. someProp != null" />


<validator id="MyStringValidator" ref="org.iscreen.StringValidator">


<failure property="minLengthFailure" key="minLengthMessage" severity="warning">

<msg name="action" key="minLengthActionMessage" />

<msg name="log_message" key="minLengthLogMessage" />



Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}