There is a validation framework in the
contrib/validator directory in the nightly source.  It
can handle date valdiations.  

<field    property="dateAsString"
   depends="required,date">
     <arg0 key="typeForm.date.displayname"/>
     <var>
       <var-name>datePatternStrict</var-name>
       <var-value>MM/dd/yyyy</var-value>
     </var>                
</field>

So if you keep your field in the ActionForm a String,
you could use one of the transformation packages to
transform the data from the ActionForm to a JavaBean
with the correct types for fields and then continue
processing your business logic.  Of course this may be
more than you want to get into if you just have the
date field and everything else doesn't need to be
transformed.

Struts Transformer by Ron Smith
http://www.rpsenterprises.com/struts/index.html

Mapper Framework by Capco
http://www.rpsenterprises.com/struts/index.html

Hope this helps.

David

--- Bill Pfeiffer <[EMAIL PROTECTED]> wrote:
> Is there a recommended method for performing normal
> date validation of struts form date property?  
> 
> It seems like I am doing a lot of work that may
> already be done (parsing date text, catching
> exception in multiple places, maintaining both text
> and date properties, etc).
> 
> Thanks in advance for any pointers,
> 
> Bill Pfeiffer
> 


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

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

Reply via email to