Use dateFormat.parse(String text) wich parses a date/time String to Date

Meenu





> -----Original Message-----
> From: Peter Pilgrim [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 25, 2001 3:48 PM
> To:   [EMAIL PROTECTED]
> Subject:      Populate Struts' Action Form Bean's Date field by a String
> input
>
> Hi
>
> I have a form bean with a Date field with accessor  and mutators
> `Date getCurrentDate()' , `void setCurrentDate( Date )' ?
>
> I have written a custom subclass of the html:text to do the following
>
> <pp:text property="currentDate"  trim="yes" >
>      <pp:dateFormat format="mm-DDD-yyyy  name="dataForm"
> property="currentDate" />
> </pp:text>
>
> Which produces this HTML
>
>      <input type="text" name="currentDate" value="25-Oct-2001" >
>
> How do write an ActionForm method mutator that converts the
> String form "25-Oct-2001" to a proper java.util.Date.
> Should I write a "void setCurrentDate( String )" method?
>
> --
> Peter Pilgrim                 ++44 (0)207-545-9923
>                                                       //_\\
> "Mathematics is essentially the study of islands of  =======
> disparate subjects in a sea of ignorance."           || ! ||
> Andrew Wiles __________________________/\________/\__||_!_||__
>
>
>
> --
>
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to