Struts 2
  1. Struts 2
  2. WW-4202

CustomTextProvider not used for validation errors of model driven actions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.15.1
    • Fix Version/s: 2.3.20
    • Component/s: Annotations, XML Validators
    • Labels:
      None

      Description

      When an application registers it's own TextProvider via 'struts.xworkTextProvider' in struts.xml, it is not used for validation errors of Model-Members of ModelDriven actions.

      Łukasz commented on the mailing list:

      > There is a bug in DelegatingValidatorContext#makeTextProvider method -
      > it should first try to use parent before creating new instance of
      > TextProvider (base on TextProviderFactory but without injecting
      > dependencies :)

        Activity

        Christoph Nenning created issue -
        Lukasz Lenart made changes -
        Field Original Value New Value
        Fix Version/s 2.3.17 [ 12324780 ]
        Hide
        Lukasz Lenart added a comment -

        Can you post link to your example app?

        Show
        Lukasz Lenart added a comment - Can you post link to your example app?
        Show
        Christoph Nenning added a comment - The example app can be found here: https://github.com/wolpi/struts2-samples/tree/master/modeldriven-and-textprovider
        Hide
        Lukasz Lenart added a comment -

        Ok, I have working solution but this can be a breaking change :\

        Show
        Lukasz Lenart added a comment - Ok, I have working solution but this can be a breaking change :\
        Hide
        Lukasz Lenart added a comment -

        Done! Thanks for demo app!

        Show
        Lukasz Lenart added a comment - Done! Thanks for demo app!
        Lukasz Lenart made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Lukasz Lenart [ lukaszlenart ]
        Resolution Fixed [ 1 ]
        Hide
        ASF subversion and git services added a comment -

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

        WW-4202 Solves problem with using wrong TextProvider for ModelDriven

        Show
        ASF subversion and git services added a comment - Commit a6017dcac42123cc41144d0d607210aa7d7c8907 in struts's branch refs/heads/develop from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=a6017dc ] WW-4202 Solves problem with using wrong TextProvider for ModelDriven
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Struts-JDK6-develop #32 (See https://builds.apache.org/job/Struts-JDK6-develop/32/)
        WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907)

        • xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
        • xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
        • xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml
        Show
        Hudson added a comment - SUCCESS: Integrated in Struts-JDK6-develop #32 (See https://builds.apache.org/job/Struts-JDK6-develop/32/ ) WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907) xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml
        Hide
        Hudson added a comment -

        ABORTED: Integrated in Struts-JDK6-master #893 (See https://builds.apache.org/job/Struts-JDK6-master/893/)
        WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907)

        • xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
        • xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
        • xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml
        Show
        Hudson added a comment - ABORTED: Integrated in Struts-JDK6-master #893 (See https://builds.apache.org/job/Struts-JDK6-master/893/ ) WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907) xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Struts-JDK6-features #41 (See https://builds.apache.org/job/Struts-JDK6-features/41/)
        WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907)

        • xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
        • xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml
        • xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Struts-JDK6-features #41 (See https://builds.apache.org/job/Struts-JDK6-features/41/ ) WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907) xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
        Lukasz Lenart made changes -
        Fix Version/s 2.3.18 [ 12319176 ]
        Fix Version/s 2.3.17 [ 12324780 ]
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Struts-JDK6-features #65 (See https://builds.apache.org/job/Struts-JDK6-features/65/)
        WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907)

        • xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
        • xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml
        • xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Struts-JDK6-features #65 (See https://builds.apache.org/job/Struts-JDK6-features/65/ ) WW-4202 Solves problem with using wrong TextProvider for ModelDriven (lukaszlenart: rev a6017dcac42123cc41144d0d607210aa7d7c8907) xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java xwork-core/src/test/resources/com/opensymphony/xwork2/TestBean-beanMessageBundle-validation.xml xwork-core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Christoph Nenning
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development