This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Struts and the fly likes intrange validator message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "intrange validator message" Watch "intrange validator message" New topic
Author

intrange validator message

Bob Cober
Greenhorn

Joined: Jan 05, 2004
Posts: 6
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

Joined: Jan 05, 2004
Posts: 6
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: intrange validator message