RE: PropertyUtils.copyProperties() usage in 1.1-b2

2002-11-17 Thread Brian Topping
Craig, Rana,

thanks for your responses, hoping you guys can provide some input:

> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Subject: Re: PropertyUtils.copyProperties() usage in 1.1-b2
> 
> > I'm trying to figure out what I am doing wrong with
> > PropertyUtils.copyProperties().  From within my Action, I have:
> >
> > User user = ;
> > DynaActionForm regForm = (DynaActionForm) form;
> > PropertyUtils.copyProperties(regForm, user);
> >
> > When I look at what copyProperties is doing, it's getting a
> > PropertyDescriptor array from getPropertyDescriptors() with the user
> > bean correctly, then it iteratively tries to see if the 
> regForm has any
> > of the properties found in the user bean.  But calling
> > getPropertyDescriptor(regForm, ) seems to be 
> comparing the
> > (correct) field names from the bean against the *structure* of the
> > DynaActionForm component (i.e. the multipartRequestHandler, 
> dynaClass,
> > servlet, etc), instead of the DynaFields that I set up in my
> > .
> >
> 
> Which CVS version number of PropertyUtils are you looking at 
> (second line
> of the sources?  The version I'm looking at, 1.32 (i.e. the current
> nightly builds), does not call getPropertyDescriptors() on a DynaBean.

K, here's what I'm seeing under PropertyUtils 1.32:

in copyProperties:

orig is neither Map nor DynaBean, so line 283 calls
getPropertyDescriptors(orig).  Then, for each readMethod in the result, line
296 has:

   String name = origDescriptors[i].getName();
   if (getPropertyDescriptor(dest, name) != null) {

But getting into getPropertyDescriptor(), line 869 calls
getPropertyDescriptors(bean).  If the dest is a DynaBean, I'm not seeing
where the "instanceof DynaBean" is -- it simply calls
Introspector.getBeanInfo().getPropertyDescriptors(), but the result of
getBeanInfo doesn't know anything about DynaBeans.

What am I missing here?  Rana says this is working and appreciate his input,
especially with the release notes reference (thanks!)  But tracing through
the code and triple-checking at the beans (they both have a "name" property),
I still can't see how this is going to work, and in practice, the destination
DynaBean is untouched.

Thanks again,

-b

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




PropertyUtils.copyProperties() usage in 1.1-b2

2002-11-16 Thread Brian Topping
Hi all, happy friday (again... :)

I'm trying to figure out what I am doing wrong with
PropertyUtils.copyProperties().  From within my Action, I have:

User user = ;
DynaActionForm regForm = (DynaActionForm) form;
PropertyUtils.copyProperties(regForm, user);

When I look at what copyProperties is doing, it's getting a
PropertyDescriptor array from getPropertyDescriptors() with the user bean
correctly, then it iteratively tries to see if the regForm has any of the
properties found in the user bean.  But calling
getPropertyDescriptor(regForm, ) seems to be comparing the
(correct) field names from the bean against the *structure* of the
DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
servlet, etc), instead of the DynaFields that I set up in my .

I don't think nested properties are the answer, and copyProperties() is
supposed to work with DynaBean in the source, destination, both or neither.  

Any ideas?  The code seems to work fine when the source and destination are
reversed.  I'm using 1.1-b2.

Thanks a bunch,

Brian

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




PropertyUtils.copyProperties() usage in 1.1-b2

2002-11-16 Thread Brian Topping
Hi all, happy friday (again... :)

I'm trying to figure out what I am doing wrong with
PropertyUtils.copyProperties().  From within my Action, I have:

User user = ;
DynaActionForm regForm = (DynaActionForm) form;
PropertyUtils.copyProperties(regForm, user);

When I look at what copyProperties is doing, it's getting a
PropertyDescriptor array from getPropertyDescriptors() with the user bean
correctly, then it iteratively tries to see if the regForm has any of the
properties found in the user bean.  But calling
getPropertyDescriptor(regForm, ) seems to be comparing the
(correct) field names from the bean against the *structure* of the
DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
servlet, etc), instead of the DynaFields that I set up in my .

I don't think nested properties are the answer, and copyProperties() is
supposed to work with DynaBean in the source, destination, both or neither.  

Any ideas?  The code seems to work fine when the source and destination are
reversed.  I'm using 1.1-b2.

Thanks a bunch,

Brian

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: PropertyUtils.copyProperties() usage in 1.1-b2 ; problem using validation with LookupDispatchAction

2002-11-15 Thread VEDRE, RANAPRATAP REDDY

 I am able to get copyProperties to work with BeanUtils and PropertyUtils
using version 1.5 of commons beanutils.

1. i am using DynaValidatorForm. 
2. i have a BeanInfoClass for my bean providing the PropertyDescriptors.

 try replacing the commons-beanutils.jar with the latest version(1.5) of
commons beanutils.

 i have one more issue, has anybody succesfully combined Validator
Framework, Dynamic Forms and LookupDispatchAction .

I am using DynaValidatorForm, but my form us not validated even if have
validate="true" in my action mapping.

validation of DynaValidatorForm worked fine before using
LookupDispatchAction.

-rana.



-Original Message-
From: Brian Topping [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 15, 2002 8:16 PM
To: [EMAIL PROTECTED]
Subject: Re: PropertyUtils.copyProperties() usage in 1.1-b2


> 
> 
> 
> On Fri, 15 Nov 2002, Brian Topping wrote:
> 
> > Date: Fri, 15 Nov 2002 12:10:53 -0800 (PST)
> > From: Brian Topping <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: PropertyUtils.copyProperties() usage in 1.1-b2
> >
> > Hi all, happy friday (again... :)
> >
> > I'm trying to figure out what I am doing wrong with
> > PropertyUtils.copyProperties().  From within my Action, I have:
> >
> > User user = ;
> > DynaActionForm regForm = (DynaActionForm) form;
> > PropertyUtils.copyProperties(regForm, user);
> >
> > When I look at what copyProperties is doing, it's getting a
> > PropertyDescriptor array from getPropertyDescriptors() with the user
> > bean correctly, then it iteratively tries to see if the regForm has any
> > of the properties found in the user bean.  But calling
> > getPropertyDescriptor(regForm, ) seems to be comparing the
> > (correct) field names from the bean against the *structure* of the
> > DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
> > servlet, etc), instead of the DynaFields that I set up in my
> > .
> >
> 
> Which CVS version number of PropertyUtils are you looking at (second line
> of the sources?  The version I'm looking at, 1.32 (i.e. the current
> nightly builds), does not call getPropertyDescriptors() on a DynaBean.

I was using 1.30, but the code I was looking at seems to be the same on
both 1.32 and 1.30.

> > I don't think nested properties are the answer, and copyProperties() is
> > supposed to work with DynaBean in the source, destination, both or
> > neither.
> >
> > Any ideas?  The code seems to work fine when the source and destination
> > are reversed.  I'm using 1.1-b2.
> >
> 
> Please try a recent nightly build.  Besides bugfixes in Struts, there have
> been bugfixes in the Commons packages as well.

Yes, trying that now, no luck.  I guess it sounds like a local issue,
since you probably would have recognized if I had been doing something
silly :)

I'll keep looking, it just doesn't seem to be doing an instanceof on the
dest bean anywhere in the call chain to see if it should treat the
DynaBean differently.

> 
> > Thanks a bunch,
> >
> > Brian
> 
> Craig

thanks again,

-b

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyUtils.copyProperties() usage in 1.1-b2

2002-11-15 Thread Brian Topping
> 
> 
> 
> On Fri, 15 Nov 2002, Brian Topping wrote:
> 
> > Date: Fri, 15 Nov 2002 12:10:53 -0800 (PST)
> > From: Brian Topping <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: PropertyUtils.copyProperties() usage in 1.1-b2
> >
> > Hi all, happy friday (again... :)
> >
> > I'm trying to figure out what I am doing wrong with
> > PropertyUtils.copyProperties().  From within my Action, I have:
> >
> > User user = ;
> > DynaActionForm regForm = (DynaActionForm) form;
> > PropertyUtils.copyProperties(regForm, user);
> >
> > When I look at what copyProperties is doing, it's getting a
> > PropertyDescriptor array from getPropertyDescriptors() with the user
> > bean correctly, then it iteratively tries to see if the regForm has any
> > of the properties found in the user bean.  But calling
> > getPropertyDescriptor(regForm, ) seems to be comparing the
> > (correct) field names from the bean against the *structure* of the
> > DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
> > servlet, etc), instead of the DynaFields that I set up in my
> > .
> >
> 
> Which CVS version number of PropertyUtils are you looking at (second line
> of the sources?  The version I'm looking at, 1.32 (i.e. the current
> nightly builds), does not call getPropertyDescriptors() on a DynaBean.

I was using 1.30, but the code I was looking at seems to be the same on
both 1.32 and 1.30.

> > I don't think nested properties are the answer, and copyProperties() is
> > supposed to work with DynaBean in the source, destination, both or
> > neither.
> >
> > Any ideas?  The code seems to work fine when the source and destination
> > are reversed.  I'm using 1.1-b2.
> >
> 
> Please try a recent nightly build.  Besides bugfixes in Struts, there have
> been bugfixes in the Commons packages as well.

Yes, trying that now, no luck.  I guess it sounds like a local issue,
since you probably would have recognized if I had been doing something
silly :)

I'll keep looking, it just doesn't seem to be doing an instanceof on the
dest bean anywhere in the call chain to see if it should treat the
DynaBean differently.

> 
> > Thanks a bunch,
> >
> > Brian
> 
> Craig

thanks again,

-b

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: PropertyUtils.copyProperties() usage in 1.1-b2

2002-11-15 Thread VEDRE, RANAPRATAP REDDY

 try getting the latest version of commons-beanutils.jar from commons
project version(1.5), if u dont want to upgrade to nightly build of struts,
but use struts 1.1b2.

  In  version 1.5 of commons package, PropertyUtils works in both
directions. release notes for version 1.5 montions about this fix.

You may also want to look at BeanUtils.copyProperties(bean, bean)

-Rana


-Original Message-
From: Brian Topping [mailto:topping@;spies.com]
Sent: Friday, November 15, 2002 3:11 PM
To: [EMAIL PROTECTED]
Subject: PropertyUtils.copyProperties() usage in 1.1-b2


Hi all, happy friday (again... :)

I'm trying to figure out what I am doing wrong with
PropertyUtils.copyProperties().  From within my Action, I have:

User user = ;
DynaActionForm regForm = (DynaActionForm) form;
PropertyUtils.copyProperties(regForm, user);

When I look at what copyProperties is doing, it's getting a
PropertyDescriptor array from getPropertyDescriptors() with the user
bean correctly, then it iteratively tries to see if the regForm has any
of the properties found in the user bean.  But calling
getPropertyDescriptor(regForm, ) seems to be comparing the
(correct) field names from the bean against the *structure* of the
DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
servlet, etc), instead of the DynaFields that I set up in my
.

I don't think nested properties are the answer, and copyProperties() is
supposed to work with DynaBean in the source, destination, both or
neither.  

Any ideas?  The code seems to work fine when the source and destination
are reversed.  I'm using 1.1-b2.

Thanks a bunch,

Brian

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Re: PropertyUtils.copyProperties() usage in 1.1-b2

2002-11-15 Thread Craig R. McClanahan


On Fri, 15 Nov 2002, Brian Topping wrote:

> Date: Fri, 15 Nov 2002 12:10:53 -0800 (PST)
> From: Brian Topping <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: PropertyUtils.copyProperties() usage in 1.1-b2
>
> Hi all, happy friday (again... :)
>
> I'm trying to figure out what I am doing wrong with
> PropertyUtils.copyProperties().  From within my Action, I have:
>
> User user = ;
> DynaActionForm regForm = (DynaActionForm) form;
> PropertyUtils.copyProperties(regForm, user);
>
> When I look at what copyProperties is doing, it's getting a
> PropertyDescriptor array from getPropertyDescriptors() with the user
> bean correctly, then it iteratively tries to see if the regForm has any
> of the properties found in the user bean.  But calling
> getPropertyDescriptor(regForm, ) seems to be comparing the
> (correct) field names from the bean against the *structure* of the
> DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
> servlet, etc), instead of the DynaFields that I set up in my
> .
>

Which CVS version number of PropertyUtils are you looking at (second line
of the sources?  The version I'm looking at, 1.32 (i.e. the current
nightly builds), does not call getPropertyDescriptors() on a DynaBean.

> I don't think nested properties are the answer, and copyProperties() is
> supposed to work with DynaBean in the source, destination, both or
> neither.
>
> Any ideas?  The code seems to work fine when the source and destination
> are reversed.  I'm using 1.1-b2.
>

Please try a recent nightly build.  Besides bugfixes in Struts, there have
been bugfixes in the Commons packages as well.

> Thanks a bunch,
>
> Brian

Craig


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




PropertyUtils.copyProperties() usage in 1.1-b2

2002-11-15 Thread Brian Topping
Hi all, happy friday (again... :)

I'm trying to figure out what I am doing wrong with
PropertyUtils.copyProperties().  From within my Action, I have:

User user = ;
DynaActionForm regForm = (DynaActionForm) form;
PropertyUtils.copyProperties(regForm, user);

When I look at what copyProperties is doing, it's getting a
PropertyDescriptor array from getPropertyDescriptors() with the user
bean correctly, then it iteratively tries to see if the regForm has any
of the properties found in the user bean.  But calling
getPropertyDescriptor(regForm, ) seems to be comparing the
(correct) field names from the bean against the *structure* of the
DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
servlet, etc), instead of the DynaFields that I set up in my
.

I don't think nested properties are the answer, and copyProperties() is
supposed to work with DynaBean in the source, destination, both or
neither.  

Any ideas?  The code seems to work fine when the source and destination
are reversed.  I'm using 1.1-b2.

Thanks a bunch,

Brian

--
To unsubscribe, e-mail:   
For additional commands, e-mail: