I use two variables on the form with respective get/set methods, Timestamp timestampDate; String stringDate;
The user enter the date on the String field. On validate() method on the form I convert from String to Timestamp. If there is an exception the user gets invalid date format message, otherwise the Timestamp is populated, the action called, ... Curious to hear other approaches, Leo -----Original Message----- From: Hair, Jeffrey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 10:00 AM To: 'Struts Users Mailing List' Subject: RE: Storing date & time stamp within html form I currently have an object (the ActionForm) that contains the Timestamp object and it is stored in the request. The problem comes when submiting the form to populate the Timestamp via struts. Struts throws an exception from Beans.populate because struts doesn't handle dates. How are other people processing dates via struts? jsh -----Original Message----- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 5:04 PM To: 'Struts Users Mailing List' Subject: RE: Storing date & time stamp within html form Importance: Low I can think of a couple of ways: 1. Store your dateCreated object as a request or session attribute and access it from your action form; 2. Pass it as a string and use the java.sql.Timestamp.valueOf() method to change it back to a Timestamp. Mark -----Original Message----- From: Hair, Jeffrey [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 2:49 PM To: Struts User Mailing List (E-mail) Subject: Storing date & time stamp within html form I'm trying to preserve the date & time stamp of an object by storing the value in an html element and have struts automatically populate my ActionForm object with the value upon submit. Specifically, I have an object of type java.sql.Timestamp contained within my ActionForm. My jsp code is this: <html:form action="actionMapping"> <html:hidden property="dateCreated"/> ... </html:form> This works fine for writing the hidden html but an exception is thrown when the form is submitted. I'm looking into using jakarta's Datetime taglib in combination with struts. Has anyone else crossed this that is able to give an example or a direction that will work? Unfortunately, changing my ActionForm attribute to be of type String instead of Date is not an option. Thanx, jsh -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>