[seam-issues] [JBoss JIRA] Created: (SEAMVALIDATE-10) Investigate how InjectingConstraintValidatorFactory could be used without requiring validation.xml

Gunnar Morling (JIRA) jira-events at lists.jboss.org
Tue Mar 8 18:00:45 EST 2011


Investigate how InjectingConstraintValidatorFactory could be used without requiring validation.xml
--------------------------------------------------------------------------------------------------

                 Key: SEAMVALIDATE-10
                 URL: https://issues.jboss.org/browse/SEAMVALIDATE-10
             Project: Seam Validation
          Issue Type: Feature Request
            Reporter: Gunnar Morling
            Assignee: Gunnar Morling


Emmanuel suggested to configure the injecting constraint validator factory automatically:

{quote}
I was thinking that we might be able to go one step further with the "Dependency injection for constraint validators".
Today you ask people to configure the ConstraintValidatorFactory using some XML snippet. How about Seam transparently configure it.

You can do it programmatically at two levels:

1. during the construction of ValidatorFactory
ValidatorFactory factory = Validation
      .byDefaultProvider().configure()
         .constraintValidatorFactory( new InjectingConstraintValidatorFactory() )
         .buildValidatorFactory();

2. or during the Validator construction
validator
   .usingContext()
       .constraintValidatorFactory( new InjectingConstraintValidatorFactory() )
   .getValidator();
{quote}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list