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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: