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

Can no longer have seperate xml validations for different action methods mapped with a wildcard

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.1.8
    • Fix Version/s: 2.1.8
    • Component/s: XML Validators
    • Labels:
      None

      Description

      It used to be that if I had an action with two methods, say delete() and save(), then I could map a separate them with a single action like so:

      <action name="*Review" class="com.myCompany.ReviewAction" method="

      {1}

      ">
      <result name="success">review.ftl</result>
      </action>

      And then have separate validation files for each method like so:

      ReviewAction-deleteReview-validation.xml
      ReviewAction-saveReview-validation.xml

      Unfortunately, this has been broken by this issue: https://issues.apache.org/struts/browse/WW-2996

      as it appears to now look by the wildcard name "*Review" rather than the action name "deleteReview" or "saveReview" when looking for validation files.

      Perhaps what needs to happen is that the context should go back to being the action name (deleteReview or saveReview), but the key to the validator cache should be the config name + the method (in this case if we use | as a separator "*Review|save" and "*Review|delete". This would mean for my case I'd get two validators and two cached instances, but for the person with the issue in WW-2996, since they have a non-dynamic method, they would get only the single validator cached.

        Issue Links

          Activity

          Show
          wesw@wantii.com Wes Wannemacher added a comment - There are snapshots in a few places, if you go here - http://hudson.zones.apache.org/hudson/view/Struts/job/xwork2/ and dig down, you'll find this link - http://hudson.zones.apache.org/hudson/view/Struts/job/xwork2/73/com.opensymphony$xwork-core/artifact/com.opensymphony/xwork-core/2.1.6-SNAPSHOT/xwork-core-2.1.6-SNAPSHOT.jar Which will get you xwork-core 2.1.6-SNAPSHOT
          Hide
          perfnorm Jasper Rosenberg added a comment -

          Okay, wasn't sure if you had a nightly snapshot repository or some such. I'll be sure to check it out after the new release, thanks!

          Show
          perfnorm Jasper Rosenberg added a comment - Okay, wasn't sure if you had a nightly snapshot repository or some such. I'll be sure to check it out after the new release, thanks!
          Hide
          musachy musachy added a comment -

          you need to checkout xwork and build it, a new xwork release is in the works so you can wait for it if you want.

          Show
          musachy musachy added a comment - you need to checkout xwork and build it, a new xwork release is in the works so you can wait for it if you want.
          Hide
          perfnorm Jasper Rosenberg added a comment -

          Thanks Musachy. Where should I point maven to get a build with the fix?

          Show
          perfnorm Jasper Rosenberg added a comment - Thanks Musachy. Where should I point maven to get a build with the fix?
          Hide
          musachy musachy added a comment -

          fixed as suggested, please try it and let me know

          Show
          musachy musachy added a comment - fixed as suggested, please try it and let me know
          Hide
          musachy musachy added a comment -

          looking into this

          Show
          musachy musachy added a comment - looking into this

            People

            • Assignee:
              Unassigned
              Reporter:
              perfnorm Jasper Rosenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development