File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to get dates to ActionForm in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to get dates to ActionForm in Struts" Watch "How to get dates to ActionForm in Struts" New topic
Author

How to get dates to ActionForm in Struts

Deli Dumrul
Greenhorn

Joined: Jul 06, 2004
Posts: 9
Hi,

I am using MySQL and i have a birthdate column whose type is date. To be able to insert into this field, how should i define birthdate field in my JSP and actionform.

Thanks
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I haven't used this in a while but I'm pretty sure you do it with the regular <html:text> tag. Struts uses the BeanUtils library internally to convert the request parameters (which are always strings anyway) into the type indicated by your <form-bean/> element in struts-config.xml or by your ActionForm class.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get dates to ActionForm in Struts
 
Similar Threads
collecting and validating dates
Required field usage
scalar functions
date field in struts
JUnit on getAge (How to get a decent solution)