Uploaded image for project: 'XWork'
  1. XWork
  2. XW-789

OgnlException while setting property 'fieldName'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.0.3
    • 1.0.5
    • Validators
    • None

    Description

      I'm trying to validate a field:

      <field name="timeSelection">
      <field-validator type="expression" short-circuit="true">
      <param name="expression">
      timeOptions.indexOf(timeSelection) > -1
      </param>
      <message key="error.timeSelection.invalid"/>
      </field-validator>
      </field>

      But:

      [OgnlUtil] Caught OgnlException while setting property 'fieldName' on
      type 'com.opensymphony.xwork.validator.validators.ExpressionValidator'.
      ognl.NoSuchPropertyException: fieldName
      at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:133)
      at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1629)
      at ognl.ASTProperty.setValueBody(ASTProperty.java:105)
      at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:180)
      at ognl.SimpleNode.setValue(SimpleNode.java:249)
      at ognl.Ognl.setValue(Ognl.java:476)
      at com.opensymphony.xwork.util.OgnlUtil.setValue(OgnlUtil.java:188)
      at com.opensymphony.xwork.util.OgnlUtil.internalSetProperty(OgnlUtil.java:260)
      at com.opensymphony.xwork.util.OgnlUtil.setProperties(OgnlUtil.java:76)
      at com.opensymphony.xwork.util.OgnlUtil.setProperties(OgnlUtil.java:103)
      at com.opensymphony.xwork.util.OgnlUtil.setProperties(OgnlUtil.java:90)
      at com.opensymphony.xwork.ObjectFactory.buildValidator(ObjectFactory.java:164)
      at com.opensymphony.xwork.validator.ValidatorFactory.getValidator(ValidatorFactory.java:54)
      at com.opensymphony.xwork.validator.ValidatorFileParser.addValidators(ValidatorFileParser.java:145)
      at com.opensymphony.xwork.validator.ValidatorFileParser.parseActionValidators(ValidatorFileParser.java:100)
      at com.opensymphony.xwork.validator.ActionValidatorManager.loadFile(ActionValidatorManager.java:264)

      This exception makes xwork add the error as an action error and not as
      a field error, which is wrong...

      Attachments

        Activity

          People

            Unassigned Unassigned
            shadow Andrei Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: