Muhammad Momin Rashid wrote:
Hello,
I've just migrated our application from strtus 1.1 to 1.2.4.
I wanted to add a doubleRange check on one of the fields in my jsp. After much hassle I found out that doubleRange validation is not defined in the validation-rules file. Whereas, according to the documentation it is a standard built in validtion.
Can anyone shed some light on this?
Regards,
Muhammad Momin Rashid.
There are already 2 bugzilla reports regarding this. #20883 and 27089.
The code you can use in your validator-rules until this gets fixed in a struts version is:
<validator name="doubleRange" classname="org.apache.struts.validator.FieldChecks" method="validateDoubleRange" methodParams="java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest" depends="double" msg="errors.range" />
This will not do javascript validation of the doublerange though. I thought that this code:
<validator name="doubleRange"
classname="org.apache.struts.validator.FieldChecks"
method="validateDoubleRange"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends="double"
msg="errors.range"
jsFunction="org.apache.commons.validator.javascript.validateFloatRange"/>
would allow the doublerange, but it doesn't seem to be working for me. If I figure it out I will let you know.
Matt
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]