You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Deadman, Hal" <ha...@tallan.com> on 2001/02/07 18:26:45 UTC

specifying default values for forms

Is there a way to specify default values other than zero for when an
ActionForm setter method takes a number argument and the conversion of the
string input fails? I seem to recall discussion of this feature but I can't
dig up the thread. 
 
Thanks, Hal

Re: specifying default values for forms

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
"Deadman, Hal" wrote:

>  Is there a way to specify default values other than zero for when an
> ActionForm setter method takes a number argument and the conversion of
> the string input fails? I seem to recall discussion of this feature
> but I can't dig up the thread. Thanks, Hal

The ConvertUtils class was recently enhanced to include mechanisms to
set the default value returned in such cases.  These settings are global
to your webapp, so they will affect conversion failures on all
properties of a given type.  This is in the current nightly builds.

In Struts 1.1, we need to provide finer-grained control over this as
part of enhanced validation processing (i.e. things like per-property
default values and such).

Craig