Ashwin Prabhu created TRINIDAD-2506:
---------------------------------------

             Summary: Ensure all the Trinidad Validators are compliant with 
version 2 of JSF specification
                 Key: TRINIDAD-2506
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2506
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 2.1.0-core
            Reporter: Ashwin Prabhu


As per the JSF 2 spec, validators should be invoked on empty/null value 
submissions. This differs from the 1.2 behavior, where validators were invoked 
only on non-null or non-empty fields. 

Validators that are the part of Trinidad distribution, like: RegExpValidator, 
LengthValidator are not ver 2.0 compilant and hence choke on null/empty values. 
These need to be corrected.

The new spec has the following to say about the validation behavior going ahead:
    "For a validator to be fully compliant with Version 2 and later of the 
specification, it must not fail validation on null or empty values unless it is 
specifically intended to address null or empty values. An application-wide 
<context-param> is provided to allow validators designed for JSF 1.2 to work 
with JSF 2 and later. The javax.faces.VALIDATE_EMPTY_FIELDS <context-param> 
must be set to false to enable this backwards compatibility behavior."

More info here:
http://docs.oracle.com/javaee/7/api/javax/faces/validator/Validator.html#validate(javax.faces.context.FacesContext,
 javax.faces.component.UIComponent, java.lang.Object)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to