I would think so.  I'm not as familiar with the internals of BeanUtils
as I'd like to be, but since your form is in request scope, that means
it'll create a new instance upon submission.  From that, it'll call
getDependent().  If that returns null, I'm not sure what BeanUtils
would do.  I'd bet it'd just throw an error, and if I had time I'd
like to see if I can win that bet.

Hubert


On 6/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Is this the only way to do it ?
> I have always never coded anything additional in the getter/setter
> methods.
> 
> - Glenn
> 
> 
> 
> 
> Hubert Rabago <[EMAIL PROTECTED]>
> 07/06/2005 05:42 PM
> Please respond to
> "Struts Users Mailing List" <user@struts.apache.org>
> 
> 
> To
> Struts Users Mailing List <user@struts.apache.org>
> cc
> 
> Subject
> Re: How to get posted data into a nested object ?
> 
> 
> 
> 
> 
> 
> It's not clear within your error at which point the error is
> occurring.  The problem could be that when BeanUtils tries to populate
> the firstName field of the dependent bean, dependent is null.  Maybe
> you need to modify your form so that getDependent() always returns a
> valid DependentVO object, instantiating one as needed.
> 
> Hubert

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

Reply via email to