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

Nested visitor validator returns wrong full field name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.20
    • Component/s: None
    • Labels:
    • Flags:
      Patch

      Description

      Original issue report: http://stackoverflow.com/questions/23544452/chaining-visitor-validator-in-struts-2.

      This bug can be reproduced by nesting two or more visitor validators with a conversion validator in the last validation configuration.

      Conversion validator in nested visitor validators doesn't work as expected because getFullFieldName method in VisitorFieldValidator.AppendingValidatorContext returns not a full field name.

      This patch makes sure that the correct full field name is returned.
      Also the InternalValidatorContextWrapper-s from AnnotationActionValidatorManager and DefaultActionValidatorManager could be removed because they were introduced to fix similar issue with nested visitor validators. See https://issues.apache.org/jira/browse/XW-588 and https://issues.apache.org/jira/browse/XW-618 for more details.

        Attachments

        1. visitor-full-field-name.diff
          9 kB
          Aleksandr Mashchenko
        2. tests-visitor-full-field-name.diff
          6 kB
          Aleksandr Mashchenko

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              aleksandr-m Aleksandr Mashchenko
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: