myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rudy De Busscher (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (EXTVAL-82) Add the EmptyValueAwareValidationStrategy annotation to the Length and Pattern Annotations
Date Wed, 27 Jan 2010 08:15:34 GMT

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

Rudy De Busscher commented on EXTVAL-82:
----------------------------------------

I did some more testing to verify compatibility with previous releases (1.2.2) and standard
JSF (without Extval)
Here are the results.

Myfaces 1.2.7

   ExtVal 1.2.2
      @Length(minimum=3, maximum=50) --> Validation error when field left empty
      @Pattern(value={"[a-z]{3,}"}) --> Validation error when field left empty

   ExtVal 1.2.3-SnapShot + javax.faces.VALIDATE_EMPTY_FIELDS = true
      @Length(minimum=3, maximum=50) --> No validation error when field left empty
      @Pattern(value={"[a-z]{3,}"}) --> No validation error when field left empty

      ValidationInterceptor.isValidationStrategyCompatibleWithValue return false since no
EmptyValueAwareValidationStrategy annotation present

   ExtVal 1.2.3-SnapShot + javax.faces.VALIDATE_EMPTY_FIELDS = false
      @Length(minimum=3, maximum=50) --> No validation error when field left empty
      @Pattern(value={"[a-z]{3,}"}) --> No validation error when field left empty

      AbstractValidationInterceptor.validateValue because empty field and Web parameter is
set to false.

   ExtVal 1.2.3-SnapShot + ExtVal-82 Implemented + javax.faces.VALIDATE_EMPTY_FIELDS = false
      @Length(minimum=3, maximum=50) --> No validation error when field left empty
      @Pattern(value={"[a-z]{3,}"}) --> No validation error when field left empty

      AbstractValidationInterceptor.validateValue because empty field and Web parameter is
set to false.

   ExtVal 1.2.3-SnapShot + ExtVal-82 Implemented + javax.faces.VALIDATE_EMPTY_FIELDS = true
      @Length(minimum=3, maximum=50) --> Validation error when field left empty
      @Pattern(value={"[a-z]{3,}"}) --> Validation error when field left empty

   Since EmptyValueAwareValidationStrategy is now found


Myfaces 2.0.0-SNAPSHOT

   ExtVal 2.0.3-SnapShot + javax.faces.VALIDATE_EMPTY_FIELDS = true
      @Length(minimum=3, maximum=50) --> No validation error when field left empty
      @Pattern(value={"[a-z]{3,}"}) --> No validation error when field left empty

      ValidationInterceptor.isValidationStrategyCompatibleWithValue return false since no
EmptyValueAwareValidationStrategy annotation present

   ExtVal 2.0.3-SnapShot + javax.faces.VALIDATE_EMPTY_FIELDS = false
      @Length(minimum=3, maximum=50) --> No validation error when field left empty
      @Pattern(value={"[a-z]{3,}"}) --> No validation error when field left empty

      AbstractValidationInterceptor.validateValue because empty field and Web parameter is
set to false.


Without Extval
Myfaces 2.0.0-SNAPSHOT

   javax.faces.VALIDATE_EMPTY_FIELDS = true
      <f:validateLength minimum="3" maximum="50"/> --> Validation error when field
left empty
      <f:validateRegex pattern="[a-z]{3,}"/> --> Validation error when field left
empty

   javax.faces.VALIDATE_EMPTY_FIELDS = false
      <f:validateLength minimum="3" maximum="50"/> --> No validation error when field
left empty
      <f:validateRegex pattern="[a-z]{3,}"/> --> No validation error when field left
empty

      UIInput.shouldValidateEmptyFields return false since web parameter is set to false.

MyFaces 1.2.7
   <f:validateLength minimum="3" maximum="50"/> --> No validation error when field
left empty

   UIInput.validateValue doesn't do anything since the field is empty and not required.




> Add the EmptyValueAwareValidationStrategy annotation to the Length and Pattern Annotations
> ------------------------------------------------------------------------------------------
>
>                 Key: EXTVAL-82
>                 URL: https://issues.apache.org/jira/browse/EXTVAL-82
>             Project: MyFaces Extensions Validator
>          Issue Type: Improvement
>          Components: Property Validation
>    Affects Versions: 1.2.3-SNAPSHOT, 2.0.3-SNAPSHOT, 1.1.3-SNAPSHOT
>            Reporter: Rudy De Busscher
>            Priority: Minor
>
> Adding the EmptyValueAwareValidationStrategy allows in JSF 2.0 that Length and Pattern
validations are triggered (with the javax.faces.VALIDATE_EMPTY_FIELDS parameter set).
> They will cause a validation error with an empty string (Length annotation with minimum
set or Pattern) so the Required annotation is no longer needed.
> Tested it out with ExtVal 2.0.3-SNAPSHOT and Myfaces 2.0.0-SNAPHOT (of 21/01) and it
works as expected.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message