commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <David.K...@wamu.net>
Subject RE: [BeanUtils] Mapped properties, this maybe a bug?
Date Mon, 20 Oct 2003 15:37:53 GMT
> -----Original Message-----
> From: Anthony.Mutiso@aeso.ca [mailto:Anthony.Mutiso@aeso.ca] 
> 
> Hi Folks,
>  
> Before I post I bug report I want to see the problem I face 
> is really a bug.
>  
> I have a struts application that uses a Mapped (Map) property 
> for one of the
> form bean's property.
>  
> If in the form bean I provide :
>     public Object getXXX(String key)
>     public void setXXX(String, key, Object value)
>  
> mapped bean methods all works as it should. Both setting and 
> getting values
> work as expected when accessing the property e.g 
> myform.XXX(key1) or setting
> it.
>  
> If I add a the following method:
>     public Map getXXX()
>  
> then my setter methods no longer work. After cranking up the 
> Log4J error
> level I see that beanutils thinks that there are no setter 
> messages and that
> the property is read-only.

Properties are not "polymorphic".  A property is either a mapped
property, an indexed property, or a "scalar" property (I'm sure there's
a better, more correct term for this).  It can only be one of those.  If
you need to access data as a mapped property, and also access the map
directly, then you'll have to use two different property names, as
you've discovered.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message