Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-75

[Validator] validation breaks on multiple validation.xml (eg. with Struts 1.3)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 1.2.0 Release
    • None
    • None
    • None
    • Operating System: other
      Platform: All

    • 36899

    Description

      While bringing an app to a recent build (0909) of struts 1.3 and
      commons-validator-1.2.0, I notice the following related to ValidatorPlugIn:

      When using multiple validation files, as in:

      <plug-in clasname="org.apache.struts.validator.ValidatorPlugIn">
      <set-property property="pathnames"
      value="/WEB-INF/lib/validator-rules.xml,/WEB-INF/moduleA/validationA.xml,/WEB-INF/moduleB/validationB.xml"/>
      </plug-in>

      I get in the tomcat console:

      "WARN Overriding FormSet definition. Duplicate for locale: fr"

      Result is that validation rules on moduleA are not working.

      I suspect the message is because both validationA.xml and validationB.xml have
      a <formset language="fr">

      We used to be able to have one validationX.xml per module without problems.
      (Having the bundle attribute since struts 1.2x made that even better, so there
      could be one resource-file per module).

      I see that now commons-validator 1.2 seems to change this. I fear that without a
      fix I would have to go back to validations for 400 screens in one single
      validationABCDEF...xml.

      It looks like commons-validation 1.2 implementation builds a formset key based
      on language, country and variant, but doesn't seem to merge formsets any more.

      If my analysis is correct, my suggestion would be

      • to either have commons-validator continue to merge formsets for backward
        compatibility, and/or,
      • add a namespace or id parameter as in <formset id="moduleA" language="fr">, if
        necessary to keep the "physical map" feature.

      Attachments

        Activity

          People

            Unassigned Unassigned
            wgehner@infonoia.com Wolfgang Gehner
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: