[ 
https://issues.apache.org/jira/browse/EXTVAL-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148157#comment-13148157
 ] 

Leonardo Uribe commented on EXTVAL-138:
---------------------------------------

In JSF 2, there exists a key over application map to do that:

    /**
     * The key in the ServletContext where the Bean Validation Factory can be 
found.
     * In a managed Java EE 6 environment, the container initializes the 
ValidatorFactory
     * and stores it in the ServletContext under this key.
     * If not present, the manually instantiated ValidatorFactory is stored in 
the ServletContext
     * under this key for caching purposes.
     */
    public static final String VALIDATOR_FACTORY_KEY = 
"javax.faces.validator.beanValidator.ValidatorFactory";

I checked myfaces-bundle to see if javax.el package is imported (detect UEL) 
and it is correct, so in theory I don't see why a helper class could be 
necessary here.

But I see that in myfaces-bundle there is no optional entry for 
javax.validation as import in MANIFEST.MF file . Checking api/pom.xml it is 
there, but on bundle/pom.xml it is not, so I suppose that's the cause of the 
problem.
                
> Make an helper class to configure Myfaces validator
> ---------------------------------------------------
>
>                 Key: EXTVAL-138
>                 URL: https://issues.apache.org/jira/browse/EXTVAL-138
>             Project: MyFaces Extensions Validator
>          Issue Type: New Feature
>          Components: Bean Validation
>         Environment: equinox/Felix
>            Reporter: Charlie Mordant
>
> Hi,
> I made bean validation working well in an osgi environment. 
> The problem is that it need to export the validator 'by hand'.
> As myfaces detects Hibernate validator automatically detected Hibernate 
> implementation, I'm not able to wire these two framework.
> It would be cool to make and helper class allowing to manually wire jsr 303 
> implementation and Myfaces.
> I made an example of a running bean validation implementation in an osgi 
> environment:
> http://hudson.osgiliath.net/job/orthank-sample%20Tag/ws/
> In order to compile, you juste need to have maven 3 and run: mvn clean 
> install -DskipTests=true (integration tests are not stable for now).
> then, in order to launch run: mvn pax:provision -Dframework=equinox (or 
> -Dframework=felix) and point your browser to 
> http://localhost:8080/net.osgiliath.orthank-sample.java.web.simple_1.0.1.SNAPSHOT
> You'll be able to say hello with web services.
> You can désactivate ws client module to run it without ws.
> To test validation, try to enter an empty text in the input, you'll be 
> redirected to an error page.
> If Myfaces had this helper, a validation message could be shown to the user.
> Regards, Charlie (tcharl on twitter, cmorda...@gmail.com on gtalk) 

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


Reply via email to