myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Myfaces Wiki] Update of "Extensions/Validator/ExtVal and Spring" by GerhardPetracek
Date Sat, 01 Nov 2008 18:43:50 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by GerhardPetracek:

New page:
= Spring Support of ExtVal =

It's possible to provide a validation strategy as Spring bean.

 * Inject a Spring bean into the validation strategy
 * AOP exception handling
 * ...

//The name of annotation: @CustomRequired

//Part of the Spring configuration:

<bean id="customRequiredValidationStrategy" class="..." lazy-init="true">
    <property name="messageResolver" ref="customMsgResolver"/>
    <property name="requiredValidationService" ref="demoRequiredValidationService"/>

<bean id="customMsgResolver" class="org.apache.myfaces.extensions.validator.core.validation.message.resolver.DefaultValidationErrorMessageResolver"
    <!-- With JSF 1.2 you can use the var name of resource-bundle see faces-config.xml
    <property name="messageBundleVarName" value="messages"/>

<bean id="demoRequiredValidationService" class="..."/>

The bean name follows the available name conventions.[[BR]]
(Also custom name conventions are supported.)

A simple demo is available here:

Furthermore, it's possible to provide a Meta-Data Transformer as Spring bean.

View raw message