There is some contradiction when it comes to types in ActionForms.  The
general idea of struts is to put a bunch of Strings (or booleans) between
the application and view layer so that after unsuccessful validation the
framework can return the typed values unchanged.  In certain cases,
individual developers put in support for types other than Strings for
certain features.

The bottom line is, until there is more concensus on the use of data types,
use non String ActionForm properties at your own risk.

Edgar

> -----Original Message-----
> From: Sasha Borodin [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 24, 2003 6:10 PM
> To: Struts Users Mailing List
> Subject: Types supported by DynaActionForm (or DynaValidatorForm)
> 
> 
> OK, in the Struts manual, it says:
> 
> The types supported by DynaActionForm include:
> - java.sql.Date
> - java.sql.Time
> - java.sql.Timestamp
> ...(among others)...
> 
> What does "supported" mean though?
> 
> Cause if I try to specify a java.sql.Date field in my form in 
> struts-config:
>         <form-bean 
>             name="commissionReport"
>             type="org.apache.struts.validator.DynaValidatorForm">
>             <form-property
>                 name="payDate"
>                 type="java.sql.Date"/>
>         </form-bean>
> 
> ...and then submit a form, I get a ConversionException:
> 
> org.apache.commons.beanutils.ConversionException at 
> org.apache.commons.beanutils.converters.SqlDateConverter.conve
> rt(SqlDateConv
> erter.java:162)
> 
> And upon searching the archives, I found suggestions to use 
> SimpleDateFormat to do convert Strings-->Dates manually.
> 
> So what does "support" mean? Is there any automated 
> (non-custom) way to do this, so I can just say "(Date) 
> dynaForm.get('dateField')" :-)  Thanks!
> 
> -Sasha Borodin
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to