Hello craigmcc,

Sunday, January 28, 2001, 5:22:13 AM, you wrote:

cao> craigmcc    01/01/27 18:22:13

cao>   Modified:    src/share/org/apache/struts/util ConvertUtils.java
cao>   Log:
cao>   Provide configurable default values for numeric conversions that suffer from
cao>   a NumberFormatException error.
  
This is a old flame but is it good idea to perform to/from String
conversions in such munner? There are some undergrouond problems
with it -

1. Non valid value will be converted to the default value, but more
   logical way in this situation is to generate exception with source
   of problem description, etc. Default values may be an optional way,
   for my mind. In general values must be tested for appropriate
   values in conversion process.
2. All conversion is performed in default environment, without locale
   using.

There are validation mechanism idea for Struts appeared in this list
some weeks ago. This idea contains proposal to validate string values
in validation mechanism - outside of the ConvertUtils. Validations
may be performed in area of limits testings or values presense - not
for appropriate values for conversion. This work must be performed in
internal mechanism - by ConvertUtils.

-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to