> -Original Message-
> From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 08, 2004 1:23 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Date format woes
>
>
> > From a pure JavaBean perspective, a cl
> From a pure JavaBean perspective, a class like:
>
> package com.dotech;
>
> import java.io.Serializable;
> import java.util.Date;
>
> public class ConfusedBean implements Serializable {
> public void setDate(String s) {}
> public Date getDate() { return null; }
> }
>
> is seen by Intr
>From a pure JavaBean perspective, a class like:
package com.dotech;
import java.io.Serializable;
import java.util.Date;
public class ConfusedBean implements Serializable {
public void setDate(String s) {}
public Date getDate() { return null; }
}
is seen by Introspector as (Sun JDK 1.4.
> You wouldn't happen to have another setter method that
> accepts a different type (e.g. Date) would you?
>
> for example:
>
> ...
> ...
>
> public void setExpirationDate(Date expirationDate){
>
> ...
> ...
No, only what I posted.
--
Tim Slattery
[EMAIL PROTECTED]
--
> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 08, 2004 12:46 PM
> To: Struts Users Mailing List
> Subject: Re: Date format woes
>
>
> You wouldn't happen to have another setter method that
> accep
You wouldn't happen to have another setter method that accepts a different
type (e.g. Date) would you?
for example:
...
...
public void setExpirationDate(Date expirationDate){
...
...
--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
Use a String for the form's fields (be it Date, int, double, whatever).
Format the data before it's shown and parse it upon submission.
--- "Inamdar, Anil - Cons" <[EMAIL PROTECTED]> wrote:
> Hello,
> I have a getter and setter on a Date field in my Action form.
> When I display the field strut
> I have a getter and setter on a Date field in my Action form.
> When I display the field struts seems to call toString on the
> object. Is there a way I can control the formatting on the
> Date object thanks Anil
Yes! Use the JSTL tag.
--
Tim Slattery
[EMAIL PROTECTED]
--
8 matches
Mail list logo