Puneet Lakhina wrote:
Also, if the user leaves the <html:text> field for BigDecimal as blank, I
get an exception (string->BigDecimal conversion exception). So, is the
solution to this is to make all formbean properties to be "String" type?
you coud do something like
BigDecimal bigDecimalProperty;
public setBigDecimalProperty(String value)
{
try {
bigDecimalProperty = new BigDecimal(value);
}catch(Exception e) {
bigDecimalProperty = new BigDecimal(somedefaultval);
}
}
You could do that, or you could have BeanUtils do it for you. However,
as long as your form bean property is type BigDecimal rather than
String, you will be unable to re-display erroneous inputs. In other
words, if the user types in 'abc', you will not be able to retain that
value and redisplay it for the user to correct unless you use String.
That's why form properties should, generally, be String-valued.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]