You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by petra staub <ca...@hotmail.com> on 2002/08/26 11:59:47 UTC

BeanUtils

hi,

I know this is a struts-maillist but as the beanutils are
commonly used with struts (and I didnt get any feedback in
the commons-user list) I dare to ask my question here. :)

i recently came over the very useful classes
of the BeanUtils package. however, i have some problems...

for testing, i simply wanted to use the copyProperties
method to populate the values of one object to an other
(empty) object.

i created a class with different properties (int, float,
String, Hashtable, Vector) and the corresponding getters/
setters.

everything worked fine (the values were copied :) ) except
for the Vector which gave me an error:

Error in PropertyUtils.copyProperties():
Property vecElem has no getter method

however, I have a method "public Vector getVecElem()" and even
(for other usage) "public Object getVecElem(int idx)".

I also tried to used the ArrayList instead of a Vector what helps
to get rid of the error message, however, the values are not
copied.

Are Lists not supported with the BeanUtils? Am I simply doing
something wrong? Maybe someone can help me newbie...

Thanks a lot!



_________________________________________________________________
Mit MSN Fotos können Sie kinderleicht Ihre Fotos ausdrucken und Freunden zur 
Verfügung stellen: http://photos.msn.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: BeanUtils

Posted by "Craig R. McClanahan" <cr...@apache.org>.
JavaBeans indexed properties (which BeanUtils uses under the covers) only
support array based properties for indexed storage.

BeanUtils was extended fairly recently to do better with Lists.  If you
have a particular test case that doesn't work, please post it as an
attachment to a bug report against BeanUtils:

  http://nagoya.apache.org/bugzilla/

Craig

On Mon, 26 Aug 2002, petra staub wrote:

> Date: Mon, 26 Aug 2002 11:59:47 +0200
> From: petra staub <ca...@hotmail.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: BeanUtils
>
> hi,
>
> I know this is a struts-maillist but as the beanutils are
> commonly used with struts (and I didnt get any feedback in
> the commons-user list) I dare to ask my question here. :)
>
> i recently came over the very useful classes
> of the BeanUtils package. however, i have some problems...
>
> for testing, i simply wanted to use the copyProperties
> method to populate the values of one object to an other
> (empty) object.
>
> i created a class with different properties (int, float,
> String, Hashtable, Vector) and the corresponding getters/
> setters.
>
> everything worked fine (the values were copied :) ) except
> for the Vector which gave me an error:
>
> Error in PropertyUtils.copyProperties():
> Property vecElem has no getter method
>
> however, I have a method "public Vector getVecElem()" and even
> (for other usage) "public Object getVecElem(int idx)".
>
> I also tried to used the ArrayList instead of a Vector what helps
> to get rid of the error message, however, the values are not
> copied.
>
> Are Lists not supported with the BeanUtils? Am I simply doing
> something wrong? Maybe someone can help me newbie...
>
> Thanks a lot!
>
>
>
> _________________________________________________________________
> Mit MSN Fotos können Sie kinderleicht Ihre Fotos ausdrucken und Freunden zur
> Verfügung stellen: http://photos.msn.de
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>