• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

date field in struts

 
kalyan chowdary
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic