Commons Validator
  1. Commons Validator
  2. VALIDATOR-20

[validator] validator argument - resource="false" ignored

    Details

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

      Operating System: other
      Platform: All

      Description

      In ValidationResources.java function addOldArgRules does not set value of
      “resource”, like:
      String resource = attributes.getValue("resource");
      if (resource != null && !"".equals(resource)) {
      arg.setResource(resource);
      }
      As a result I've got struts validation message "Field can not be less than null
      characters."

      Because in config there is defined a value '2' for minlength, but commons.jar
      searches for resource with name '2' in resource bundule.

      Configuration:

      <field property="name"
      depends="required,minlength,maxlength">

      <arg0 key="fieldForm.name"/>
      <arg1
      name="minlength"
      key="$

      {var:minlength}

      "
      resource="false"
      />
      <arg1
      name="maxlength"
      key="$

      {var:maxlength}

      "
      resource="false"
      />
      <var>
      <var-name>minlength</var-name>
      <var-value>2</var-value>
      </var>
      <var>
      <var-name>maxlength</var-name>
      <var-value>4</var-value>
      </var>
      </field>

        Activity

        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Key COM-2790 VALIDATOR-20
        Project Commons [ 12310458 ] Commons Validator [ 12310494 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Affects Version/s unspecified [ 12311647 ]
        Component/s Validator [ 12311135 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 38798 12342942
        Rostislav Palivoda created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Rostislav Palivoda
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development