Markus Staab created RF-12041:
---------------------------------

             Summary: BeanValidator: no way to use BeanValidation with a custom 
config
                 Key: RF-12041
                 URL: https://issues.jboss.org/browse/RF-12041
             Project: RichFaces
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 3.3.3.Final
         Environment: Liferay 5.2.4, Portlet 2.0, JSF 1.2
            Reporter: Markus Staab


The BeanValidator class bootstraps a whole new BeanValidation context in its 
constructor:

{code} 
BeanValidator() {
                // Enforce class to load
                ValidatorFactory.class.getName();
                // Check Factory, to avoid instantiation errors
                // https://jira.jboss.org/jira/browse/RF-7226
                validatorFactory = Validation
                                        .buildDefaultValidatorFactory();
                validatorContext = validatorFactory.usingContext();
                MessageInterpolator jsfMessageInterpolator = new 
JsfMessageInterpolator(
                                validatorFactory.getMessageInterpolator());
                validatorContext.messageInterpolator(jsfMessageInterpolator);
        }
{/code} 

because of this, there is no way to use the programmatic configuration feature 
of BeanValidation.

I tried to pre-configure a custom MessageInterpolator with

{code} 
      Configuration<?> config = Validation.byDefaultProvider().configure();
      config.messageInterpolator( new MyInterpolator() );
{/code} 

but this configuration change is not taken into account by the BeanValidator of 
Richfaces.

ATM the only way to achive this sort of customization is to use a 
META-INF/validation.xml

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to