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

The AnnotationActionValidatorManager does not adhere to the ActionValidatorManager interface's contract

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.3
    • Component/s: None
    • Labels:
      None

      Description

      An ActionValidatorManager accepts a java.util.String "context" parameter for identifying the appropriate configurations. In the AnnotationActionValidatorManager's buildValidatorKey() method, however, "config.getName()" is used instead of the passed-in context. This violates the contract of the interface and tightly couples the AnnotationActionValidatorManager to the ValidationInterceptor.

      I have a situation whereby I have created my own validation interceptor for a special case that passes in a context not derived from "proxy.getActionName()" (equivalent to config.getName() except for in the case of wildcards), only to find that this context isn't used properly by the manager. I then created my own manager, changing only the buildValidatorKey() to use the given context, and it works well.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                rees.byars Rees Byars
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: