wood burning stoves 2.0*
The moose likes Struts and the fly likes date field in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "date field in struts" Watch "date field in struts" New topic
Author

date field in struts

kalyan chowdary
Greenhorn

Joined: Jun 22, 2006
Posts: 24
Hi.

I have a jsp with date filed , date is came from date picker.

Its fine date is came from datapicker, but how to set method for formbean,

I take it as a String , but return value null in action.

How to set this

Help me

Thans in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I generally store a date as type java.util.Date and have two sets of getter/setter pairs for each date -- one set that treats it as a String, and the other that treats it as a Date. Here's an example:


This code assumes that the date is being checked for valid format elsewhere in the code. In the JSP, you would then write:
<html:text property="formattedBirthDate" />
[ June 29, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: date field in struts
 
Similar Threads
Retrieving SQL generated value
how can i set caharcter encoding in js file
Date question
SimpleDateFormat
How to retrieve Date from JDBC using sql