You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sakke Wiik <sa...@netikos.fi> on 2003/02/05 07:09:43 UTC
Validating a "long" using validation.xml accepts all values
I don't have problems with any validations except validating
longs. I'm trying to validate a long value using DynaValidatorForm.
If i put something else than a long as a
requestparameter(/theAction?id=someletters),
the validator does not return an error. Instead the action is called, which
gets
the value 0(zero) from the form. Shouldn't the validator return an error?
struts-config.xml:
<form-bean name="theForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="id" type="java.lang.Long"/>
</form-bean>
<action path="/theAction" type="TheAction" name="theForm"
input="/theframe.jsp" scope="request"/>
validation.xml:
<form name="theForm">
<field property="id" depends="required,long">
<arg0 key="theform.id.displayname"/>
</field>
</form>
cheers,
Sakke Wiik
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org