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

On 6/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Short description:
> -------------------------
> How do I get posted data into a bean within the form bean ?
> 
> The JSP has this code.
> <html-el:text property="dependent.firstName" maxlength="15" value=
> "${dependentForm.dependent.firstName}"/>
> 
> The page is posted and I get this error:
> [07/06/05 15:15:22:743 EDT] 6aa06aa0 WebGroup      E SRVE0026E: [Servlet
> Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: No bean
> specified
> 
> Really I'm getting exasperated trying to get this working.
> All of the examples I've found deal with collections or simply getting 
the
> data onto the page.
> I need to pick it up from the page.
> 
> 
> Long Description:
> -------------------------
> My form bean contains a value object.
> public class DependentForm extends ActionForm {
>    private ImageButtonBean addButton = new ImageButtonBean();
>    private ImageButtonBean cancelButton = new ImageButtonBean();
>    private DependentVO dependent;
> ...
> 
> public class DependentVO extends Dependent {
> ...
> 
> public class Dependent extends People {
> ...
> 
> public class People {
>    private Date dateOfBirth;
>    private int employeeNumber;
>    private String firstName;
>    private String lastName;
>    private String relationshipCode;
>    private String sexTypeCode;
>    private String smokerIndicator;
> 
> The JSP has this code.
> <html-el:text property="dependent.firstName" maxlength="15" value=
> "${dependentForm.dependent.firstName}"/>
> 
> TIA,
> Glenn
>

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



Reply via email to