I have the following field in my Action:
Integer _personIDNumber;
And the following input field in my JSP:
<input type="text" name="personIDNumber" value="" />
My validation requirements are:
<validators>
<field name="personIDNumber">
<field-validator type="required">
<message>You must enter a value for person ID
number.</message>
</field-validator>
</field>
</validators>
When the code executes and I supply no value in the input box, I get the
following OGNL exception:
com.opensymphony.xwork.interceptor.ParametersInterceptor] Setting params
{personIDNumber=[Ljava.lang.String;@f3387}
java.lang.NumberFormatException: For input string: ""
java.lang.NumberFormatException.forInputString(NumberFormatException.jav
a:48)
java.lang.Long.parseLong(Long.java:344)
java.lang.Long.parseLong(Long.java:381)
ognl.OgnlOps.longValue(OgnlOps.java:85)
ognl.OgnlOps.convertValue(OgnlOps.java:209)
ognl.DefaultTypeConverter.convertValue(DefaultTypeConverter.java:50)
com.opensymphony.xwork.XWorkBasicConverter.convertValue(XWorkBasicConver
ter.java:80)
So outside of JavaScript client-side checking is there any hope of
handling this error in my action? Same goes if I enter a non-numeric
value in the textfield.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork