You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Maya Muchnik <mm...@pumatech.com> on 2001/03/20 20:16:43 UTC

PropertyUtils.copyProperties ?

Hi,

If I am using PropertyUtils.copyProperties(user, info) then original bean
info must to have all properties that user bean has? If info has only 3
properties, and user has 18, copy will not work? I need to use this way,
because, for example, logon form needs only 3 properties, but user form (full
user info) has 18 properties. And only user bean has a method (function) to
check if a user is legal.

Thanks in advance.

Maya


Re: PropertyUtils.copyProperties ?

Posted by Maya Muchnik <mm...@pumatech.com>.
Thank you, Craig. You were right. I had removed (and forgot) a hidden property,
because I cannot figure out how to replace "nested tags".

Can somebody help me to replace <html:hidden property="B" value='<bean:message key
="A"/>'/>
Do I need to use <jsp:useBean ...><jsp:getProperty...> and bean class is
org.apache.struts.BEAN ...

Thanks,

Maya

"Craig R. McClanahan" wrote:

> On Tue, 20 Mar 2001, Maya Muchnik wrote:
>
> > Hi,
> >
> > If I am using PropertyUtils.copyProperties(user, info) then original bean
> > info must to have all properties that user bean has? If info has only 3
> > properties, and user has 18, copy will not work? I need to use this way,
> > because, for example, logon form needs only 3 properties, but user form (full
> > user info) has 18 properties. And only user bean has a method (function) to
> > check if a user is legal.
> >
>
> The copyProperties() method will only copy when the property names
> match.  It will ignore any unmatching properties in the origin or
> destination beans.
>
> > Thanks in advance.
> >
> > Maya
> >
> >
>
> Craig


Re: PropertyUtils.copyProperties ?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 20 Mar 2001, Maya Muchnik wrote:

> Hi,
> 
> If I am using PropertyUtils.copyProperties(user, info) then original bean
> info must to have all properties that user bean has? If info has only 3
> properties, and user has 18, copy will not work? I need to use this way,
> because, for example, logon form needs only 3 properties, but user form (full
> user info) has 18 properties. And only user bean has a method (function) to
> check if a user is legal.
> 

The copyProperties() method will only copy when the property names
match.  It will ignore any unmatching properties in the origin or
destination beans.

> Thanks in advance.
> 
> Maya
> 
> 

Craig