You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Leandro Melo <lt...@yahoo.com.br> on 2004/09/08 16:21:29 UTC

ActionForm data type X BeanUtils -> using Dates

Hi,
i believe that a lot of developers use BeanUtils to
copy the data from ActionForms to the specific DTOs.
I've used this approach, but right now i'm facing a
problem, not a big one.

I've allways been confused about working with dates in
Java. I got a jsp where the user must input a date in
the following format.

Date: dd/mm/yyyy  

That's how we use dates in Brazil: the day, month and
year.

I'd like to make a validation if the user input the
date in the correct manner in the ActionForm (i'm
using traditional validation and the user input comes
in a String). So, keeping in mind the variou ways of
doing this date validation (even the deprecated ones),
how should a do the date validation???? Which one is
the best way??? I just want to check if the user input
a day with 2 digits,  a slash, a month with 2 digits,
a slash and a year with 4 digits.

Also, after that i'd like to copy this form data to my
DTO with BeanUtils. Which type should i use in my DTO 
for this date??? 

Thanks,
Leandro.




	
	
		
_______________________________________________________
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! 
http://br.acesso.yahoo.com/

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