commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Jakarta Commons Wiki] New: ValidatorDatesFormatting
Date Thu, 20 May 2004 19:53:47 GMT
   Date: 2004-05-20T12:53:47
   Editor: RobertBurrellDonkin <>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorDatesFormatting

   Movced from original wiki

New Page:

Up to ValidatorFaq

Do most people allow users to type in a complete free-form text date?  Or do
you give them three boxes where they must put in month day and year

I'm trying to come to terms with validation.  I can't turn on the automatic
validation <action validate="true" ... > because the users are allowed to
leave the form before it's complete and come back to it.  Will I still be
able to use the plug-in Validator?  (All the actions in the struts-validator
example have 'validate' this turned on. 

But here's where I get lost.  In order to copy the properties back and forth
from Value Object to ActionForm, the types have to match.  (Don't they?) But
if I put a java.sql.Date into my ActionForm, then it will blow up when the
user types 7/13/1985 rather than 1985-07-13 and submits the form.

So, I need a String property in the ActionForm, and ... some special
something that turns it into a java.sql.Date but will not blow up if the
input is wrong?

== Answer(s) ==

we use this

-Tim Cronin

Also Commons BeanUtils provides a number of automatic conversions, so this
might be performed already.

Rob Leland
Up to ValidatorFaq

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message