Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

intrange validator message

 
Bob Cober
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks in advance for any help

I am using the intrange feature of validator. The validation works(it tests for the value between min and max) but the message displayed is wrong( it says "not in the range null through null").

Here is my entry in validation.xml:
<field property="frmCrimeCustody" depends="required,integer,intRange">
<arg0 key="error.frmCrimeCustody.required"/>
<arg1
name="intRange"
key="${var:min}"
resource="false"/>
<arg2
name="intRange"
key="${var:max}"
resource="false"/>
<var>
<var-name>min</var-name>
<var-value>0</var-value>
</var>
<var>
<var-name>max</var-name>
<var-value>10</var-value>
</var>
</field>


Thanks again for any help.....
 
Bob Cober
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW application.properties has:
errors.range={0} is not in the range {1} through {2}.

and validation-rules.xml:
<validator name="intRange"
classname="org.apache.struts.validator.FieldChecks"
method="validateIntRange"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"
depends="integer"
msg="errors.range"/>


Thanks again for help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic