myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kennard Consulting (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-3299) Programmatically generated components do not register with Bean Validation
Date Thu, 02 Aug 2012 10:39:02 GMT

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

Kennard Consulting commented on MYFACES-3299:
---------------------------------------------

Okay it looks like MyFaces determines 'if a JSF 303 engine is present' by doing...

    Class.forName( "javax.validation.Validation" )

...in javax.faces.validator._ExternalSpecifications
                
> Programmatically generated components do not register with Bean Validation
> --------------------------------------------------------------------------
>
>                 Key: MYFACES-3299
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3299
>             Project: MyFaces Core
>          Issue Type: Bug
>            Reporter: Kennard Consulting
>         Attachments: jsf-validation.zip
>
>
> I am having problems using MyFaces with Bean Validation.
> I am not clear what the JSF spec means, but it says "Consider a simple web application
that has one page, written in Facelets for JSF 2, that has a several text fields inside of
a form. This application is running in a JSF runtime in an environment that does require JSR
303 Bean Validation, and therefore this feature is available. Assume that every text field
is bound to a managed bean property that has at least one Bean Validation constraint annotation
attached to it. During the render response phase that always precedes a postback, due to the
specification requirements in Section 3.5.3 "Validation Registration", every UIInput in this
application has an instance of Validator with id javax.faces.Bean attached to it".
> George Gastaldi and I have created a sample application (attached) that demonstrates
several ways of creating a simple input text bound to Bean Validation. This must be deployed
to a Java EE 6 container (we tested against JBoss AS 6). You will note the first two pages
(Normal Facelets form, Binding Component) work fine. When you click 'Click Me' to POSTback,
Bean Validation is invoked and a validation error is displayed.
> The second two pages (Dynamic Component, Dynamic Component (with Metawidget)) do not
work as expected. They both use PreRenderViewEvent to create the inputText programmatically.
The spec is unclear whether we're meant to explicitly add a javax.faces.Bean validator in
this case? The way I read section 3.5.3, I don't think we do, but it doesn't work without
it?

--
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

        

Mime
View raw message