File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts Date Conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Date Conversion" Watch "Struts Date Conversion" New topic

Struts Date Conversion

RamandeepS Singh
Ranch Hand

Joined: Aug 25, 2009
Posts: 63

i have a jsp page in which i have a form..
form is having s:textfield tag an name dob,In Action class i have made the getter setters of the dob of type date..
but when i submit the form i get null in the action class.

But if i change the Date type to String in my action class then itt show the value..

Can anyone tell me how to get Date in action class... by specifying the type date
Ankit Garg

Joined: Aug 03, 2008
Posts: 9291

What is the date format you are entering in your text field?? Its given here that the date format should be SHORT i.e. something like 12/05/09...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Struts Date Conversion
Similar Threads
sql exception when try to get date
How to get the field details from one jsp page in struts dispatchaction action class
Getting error on calling method belongs to java class.
To check the input date is future date or not
Struts Validator framework