Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4578

Validators do not work for multiple values

    Details

      Description

      The RegexFieldValidator only validates if the parameter receives is an String. So validation for multiple values (received as a String array) does not work. The same for other validators.

        Issue Links

          Activity

          Hide
          aleksandr-m Aleksandr Mashchenko added a comment -

          Have you seen any validator which works for collection or array? Take a look at visitor validator.

          Show
          aleksandr-m Aleksandr Mashchenko added a comment - Have you seen any validator which works for collection or array? Take a look at visitor validator .
          Hide
          lukaszlenart Lukasz Lenart added a comment -

          Aleksandr Mashchenko I was looking into it and it looks doable

          Show
          lukaszlenart Lukasz Lenart added a comment - Aleksandr Mashchenko I was looking into it and it looks doable
          Hide
          aleksandr-m Aleksandr Mashchenko added a comment -

          Lukasz Lenart sure it is. But if we are doing it then it should be done for all validators.

          Show
          aleksandr-m Aleksandr Mashchenko added a comment - Lukasz Lenart sure it is. But if we are doing it then it should be done for all validators.
          Hide
          lukaszlenart Lukasz Lenart added a comment -

          100% right!

          Show
          lukaszlenart Lukasz Lenart added a comment - 100% right!
          Hide
          lukaszlenart Lukasz Lenart added a comment -

          I'm going to postpone this change (to all the validators) as this is a breaking change

          Show
          lukaszlenart Lukasz Lenart added a comment - I'm going to postpone this change (to all the validators) as this is a breaking change
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user lukaszlenart opened a pull request:

          https://github.com/apache/struts/pull/128

          Multidimensional validation

          This PR adds support for validation of Collections in field validators

          Resolves WW-4578

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/lukaszlenart/struts multidimensional-validation

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/struts/pull/128.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #128


          commit caca3d057d56f43699c1ef5d37e7800eb7b0e5a5
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-04-06T06:59:11Z

          WW-4578 Makes RegexFieldValidator to support collections

          commit 158eda97834645a542e81d7414b67f8285042b8b
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-04-10T06:37:22Z

          WW-4578 Changes range validators to support collections

          commit e66fd538b519b1a156d76e4bbe4e994a35e3c464
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-04-10T07:13:14Z

          WW-4578 Makes required validator to support collections


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user lukaszlenart opened a pull request: https://github.com/apache/struts/pull/128 Multidimensional validation This PR adds support for validation of Collections in field validators Resolves WW-4578 You can merge this pull request into a Git repository by running: $ git pull https://github.com/lukaszlenart/struts multidimensional-validation Alternatively you can review and apply these changes as the patch at: https://github.com/apache/struts/pull/128.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #128 commit caca3d057d56f43699c1ef5d37e7800eb7b0e5a5 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-04-06T06:59:11Z WW-4578 Makes RegexFieldValidator to support collections commit 158eda97834645a542e81d7414b67f8285042b8b Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-04-10T06:37:22Z WW-4578 Changes range validators to support collections commit e66fd538b519b1a156d76e4bbe4e994a35e3c464 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-04-10T07:13:14Z WW-4578 Makes required validator to support collections
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cnenning commented on the issue:

          https://github.com/apache/struts/pull/128

          IMO these 4 could be considered, too:

          • `DoubleRangeFieldValidator`
          • `URLValidator`
          • `RequiredStringValidator`
          • `StringLengthFieldValidator`
          Show
          githubbot ASF GitHub Bot added a comment - Github user cnenning commented on the issue: https://github.com/apache/struts/pull/128 IMO these 4 could be considered, too: `DoubleRangeFieldValidator` `URLValidator` `RequiredStringValidator` `StringLengthFieldValidator`
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user lukaszlenart commented on the issue:

          https://github.com/apache/struts/pull/128

          • `DoubleRangeFieldValidator`
          • `URLValidator`
          • `RequiredStringValidator`
          • `StringLengthFieldValidator`
          Show
          githubbot ASF GitHub Bot added a comment - Github user lukaszlenart commented on the issue: https://github.com/apache/struts/pull/128 `DoubleRangeFieldValidator` `URLValidator` `RequiredStringValidator` `StringLengthFieldValidator`
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user lukaszlenart commented on the issue:

          https://github.com/apache/struts/pull/128

          • `DoubleRangeFieldValidator`
          • `URLValidator`
          • `RequiredStringValidator`
          • `StringLengthFieldValidator`
          Show
          githubbot ASF GitHub Bot added a comment - Github user lukaszlenart commented on the issue: https://github.com/apache/struts/pull/128 `DoubleRangeFieldValidator` `URLValidator` `RequiredStringValidator` `StringLengthFieldValidator`
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user lukaszlenart commented on the issue:

          https://github.com/apache/struts/pull/128

          • `DoubleRangeFieldValidator`
          • `URLValidator`
          • `RequiredStringValidator`
          • `StringLengthFieldValidator`
          Show
          githubbot ASF GitHub Bot added a comment - Github user lukaszlenart commented on the issue: https://github.com/apache/struts/pull/128 `DoubleRangeFieldValidator` `URLValidator` `RequiredStringValidator` `StringLengthFieldValidator`
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user lukaszlenart commented on the issue:

          https://github.com/apache/struts/pull/128

          • `DoubleRangeFieldValidator`
          • `URLValidator`
          • `RequiredStringValidator`
          • `StringLengthFieldValidator`
          Show
          githubbot ASF GitHub Bot added a comment - Github user lukaszlenart commented on the issue: https://github.com/apache/struts/pull/128 `DoubleRangeFieldValidator` `URLValidator` `RequiredStringValidator` `StringLengthFieldValidator`
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user wolpi commented on the issue:

          https://github.com/apache/struts/pull/128

          +1 for merging 😆

          Show
          githubbot ASF GitHub Bot added a comment - Github user wolpi commented on the issue: https://github.com/apache/struts/pull/128 +1 for merging 😆
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 01a56ca117532c63a89bec6464109e81d9273d62 in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=01a56ca ]

          WW-4578 Converts double range validator to support collections

          Show
          jira-bot ASF subversion and git services added a comment - Commit 01a56ca117532c63a89bec6464109e81d9273d62 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=01a56ca ] WW-4578 Converts double range validator to support collections
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit df5583f11789fe2f5084d7fec780f99fa8d22b23 in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=df5583f ]

          WW-4578 Converts required string validator to support collections

          Show
          jira-bot ASF subversion and git services added a comment - Commit df5583f11789fe2f5084d7fec780f99fa8d22b23 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=df5583f ] WW-4578 Converts required string validator to support collections
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/struts/pull/128

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/struts/pull/128
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 16e8f10f6664f4d5abbc64650a0b7a93cd49290b in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=16e8f10 ]

          WW-4578 Converts length string validator to support collections

          Show
          jira-bot ASF subversion and git services added a comment - Commit 16e8f10f6664f4d5abbc64650a0b7a93cd49290b in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=16e8f10 ] WW-4578 Converts length string validator to support collections
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 6f272e4873bdba03c1b3fe3ac8c0670b680d2c6c in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=6f272e4 ]

          WW-4578 Converts URL validator to support collections

          Show
          jira-bot ASF subversion and git services added a comment - Commit 6f272e4873bdba03c1b3fe3ac8c0670b680d2c6c in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=6f272e4 ] WW-4578 Converts URL validator to support collections
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 569e1f6c82dbb562f105279df68e3dd2cf0545bd in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=569e1f6 ]

          WW-4578 Fixes small typo

          Show
          jira-bot ASF subversion and git services added a comment - Commit 569e1f6c82dbb562f105279df68e3dd2cf0545bd in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=569e1f6 ] WW-4578 Fixes small typo
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1ad6d2c31726864275458c02f9cbbe22936f7833 in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=1ad6d2c ]

          WW-4578 Cleans up code

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1ad6d2c31726864275458c02f9cbbe22936f7833 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=1ad6d2c ] WW-4578 Cleans up code
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 5fd605eb974cdbaa2df57ec6f783f37a6106279f in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=5fd605e ]

          WW-4578 Supports collections when validating a value

          Show
          jira-bot ASF subversion and git services added a comment - Commit 5fd605eb974cdbaa2df57ec6f783f37a6106279f in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=5fd605e ] WW-4578 Supports collections when validating a value
          Hide
          lukaszlenart Lukasz Lenart added a comment -

          PR got merged

          Show
          lukaszlenart Lukasz Lenart added a comment - PR got merged
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Struts-JDK7-master #617 (See https://builds.apache.org/job/Struts-JDK7-master/617/)
          WW-4578 Makes RegexFieldValidator to support collections (lukaszlenart: rev caca3d057d56f43699c1ef5d37e7800eb7b0e5a5)

          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/RegexFieldValidatorTest.java
            WW-4578 Changes range validators to support collections (lukaszlenart: rev 158eda97834645a542e81d7414b67f8285042b8b)
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RangeValidatorSupport.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/ValidationAction.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldValidatorSupport.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/IntRangeFieldValidatorTest.java
            WW-4578 Makes required validator to support collections (lukaszlenart: rev e66fd538b519b1a156d76e4bbe4e994a35e3c464)
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/ValidationAction.java
          • (add) core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredFieldValidatorTest.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RequiredFieldValidator.java
            WW-4578 Converts double range validator to support collections (lukaszlenart: rev 01a56ca117532c63a89bec6464109e81d9273d62)
          • (add) core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeFieldValidatorTest.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/DoubleRangeFieldValidator.java
          • (delete) core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeValidatorTest.java
            WW-4578 Converts required string validator to support collections (lukaszlenart: rev df5583f11789fe2f5084d7fec780f99fa8d22b23)
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/ValidationAction.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidatorTest.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldValidatorSupport.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidator.java
            WW-4578 Converts length string validator to support collections (lukaszlenart: rev 16e8f10f6664f4d5abbc64650a0b7a93cd49290b)
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/StringLengthFieldValidatorTest.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java
            WW-4578 Converts URL validator to support collections (lukaszlenart: rev 6f272e4873bdba03c1b3fe3ac8c0670b680d2c6c)
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java
            WW-4578 Fixes small typo (lukaszlenart: rev 569e1f6c82dbb562f105279df68e3dd2cf0545bd)
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java
            WW-4578 Cleans up code (lukaszlenart: rev 1ad6d2c31726864275458c02f9cbbe22936f7833)
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidator.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #617 (See https://builds.apache.org/job/Struts-JDK7-master/617/ ) WW-4578 Makes RegexFieldValidator to support collections (lukaszlenart: rev caca3d057d56f43699c1ef5d37e7800eb7b0e5a5) (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java (edit) core/src/test/java/com/opensymphony/xwork2/validator/RegexFieldValidatorTest.java WW-4578 Changes range validators to support collections (lukaszlenart: rev 158eda97834645a542e81d7414b67f8285042b8b) (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RangeValidatorSupport.java (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/ValidationAction.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldValidatorSupport.java (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/IntRangeFieldValidatorTest.java WW-4578 Makes required validator to support collections (lukaszlenart: rev e66fd538b519b1a156d76e4bbe4e994a35e3c464) (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/ValidationAction.java (add) core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredFieldValidatorTest.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RequiredFieldValidator.java WW-4578 Converts double range validator to support collections (lukaszlenart: rev 01a56ca117532c63a89bec6464109e81d9273d62) (add) core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeFieldValidatorTest.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/DoubleRangeFieldValidator.java (delete) core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeValidatorTest.java WW-4578 Converts required string validator to support collections (lukaszlenart: rev df5583f11789fe2f5084d7fec780f99fa8d22b23) (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/ValidationAction.java (edit) core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidatorTest.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldValidatorSupport.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidator.java WW-4578 Converts length string validator to support collections (lukaszlenart: rev 16e8f10f6664f4d5abbc64650a0b7a93cd49290b) (edit) core/src/test/java/com/opensymphony/xwork2/validator/StringLengthFieldValidatorTest.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java WW-4578 Converts URL validator to support collections (lukaszlenart: rev 6f272e4873bdba03c1b3fe3ac8c0670b680d2c6c) (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java (edit) core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java WW-4578 Fixes small typo (lukaszlenart: rev 569e1f6c82dbb562f105279df68e3dd2cf0545bd) (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java WW-4578 Cleans up code (lukaszlenart: rev 1ad6d2c31726864275458c02f9cbbe22936f7833) (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java (edit) core/src/main/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidator.java

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              jlmagc Jose L Martinez-Avial
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development