commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: BeanUtils SqlConversion
Date Mon, 08 Mar 2004 22:41:21 GMT
Quoting Amir Nashat <anashat@cj.com>:

>  
> 
> Hello,
> 
>  
> 
> I am aware that there is a switch to allow for a default value but if
> you use the BeanUtils component this switch is not available to set. I
> am wondering if there is any way to: 
> 
> 1) Specify a default value and use that value 
> 

Why not?  Can't you just re-register the standard converters with the versions
that return default values instead of errors?

> 2) If not the first option then to ignore the conversion all together
> and move on with the next conversion

Personally, I would not choose this strategy, because the failed conversions are
just hiding a problem that is going to bite you later.  Instead, I would set up
a validation strategy to check the incoming values to make sure they are
syntactically correct and will not cause conversion errors.

This is exactly why Struts encourages you to use Strings for form bean
properties, for example.

> 
>  
> 
> I am curious as to whether or not the BeanUtils component has created a
> bug in its implementation or missed this fact?
> 
>  
> 
> Anybody out there have any suggestions?
> 
>  
> 
> Thanks!
> 
>  
> 
> Amir

Craig McClanahan


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message