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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.3
    • None
    • 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

        1. ww3753_patch
          5 kB
          Rees Byars

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: