why not just return a boolean??? the .toString() representation of a boolean
is the strings "true or "false"
Works for me...

Mikkel

-----Oprindelig meddelelse-----
Fra: Eric Rasmussen [mailto:[EMAIL PROTECTED]]
Sendt: 17 May 2001 00:14
Til: [EMAIL PROTECTED]
Emne: Re: Trouble setting properties of an ActionForm bean


As far as I know, the value passed into the setter method must match the
value returned by the getter method.  It will not work otherwise.

Could you return 'true' or 'false' as a String?  If you are setting a value
of a field, it should work.

    - eric

----- Original Message -----
From: "Peter Smith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 16, 2001 1:54 PM
Subject: Trouble setting properties of an ActionForm bean


> I'm hoping this issue is me just not understanding the
> JavaBeans spec!
>
> When I make the getter method of my ActionForm
> property
> a non-String type, the 'set' method for that property
> is not called when a request is made.  I traced this
> to
> BeanUtils.java which gets a 'null' returned by
> 'propertyDescriptorInstance'.getWriteMethod() for the
> offending method.
>
> The code for my ActionForm with the offending property
> is shown below.  I changed the return type of
> getShowInstructions() to boolean instead of String.
>
> Thanks for any advice.
>
> --Peter--
>
> -------------------------------------------------
>
> ...
>   private String showInstructions_;
>
>   public void setShowInstructions(
>     String showInstructions )
>   {
>     showInstructions_ = showInstructions;
>   }
>
>   public boolean getShowInstructions()
>   {
>     return ( Boolean.valueOf(
>       showInstructions_ ) ).booleanValue();
>   }
> ...
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>

Reply via email to