You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Hogan <me...@mikehogan.net> on 2002/05/01 03:13:39 UTC

How to map form data to a HIERARCHY of domain objects

Hi, I want to map data posted from a form to a hierarchy of domain objects.
For exampe, my form includes the following information:

Person first name
Person last name
Company name
Company address

I would like a javabean hierarchy, whose root is an object of type Person,
and which allows me do the following:

person.getFirstname();
person.getLastname();
person.getCompany();
person.getCompany().getAddress()

The last line is the crucial bit. It indicates that I require mapping of the
form data to a nested object model. Is there a component in Struts to do
this?

I expect there is, but have so far been unable to find it.

Thanks for your help,
Mike




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


Re: How to map form data to a HIERARCHY of domain objects

Posted by Victor Hadianto <vi...@nuix.com.au>.
> Hi, I want to map data posted from a form to a hierarchy of domain objects.

http://jakarta.apache.org/struts/struts-nested.html


-- 
Victor Hadianto
---------------
That's the thing about people who think they hate computers.  What they
really hate is lousy programmers.
- Larry Niven and Jerry Pournelle in "Oath of Fealty"

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


RE: How to map form data to a HIERARCHY of domain objects

Posted by Alex Paransky <ap...@standardset.com>.
Struts does this by default,

name="person" property="firstName"
name="person" property="lastName"
name="person" property="company.name"
name="person" property="company.addresss.line1"
name="person" property="company.addresss.line2"
name="person" property="company.addresss.line3"

-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
http://www.myprofiles.com/member/profile/apara_personal

-----Original Message-----
From: Mike Hogan [mailto:me@mikehogan.net]
Sent: Tuesday, April 30, 2002 6:14 PM
To: struts-user@jakarta.apache.org
Subject: How to map form data to a HIERARCHY of domain objects


Hi, I want to map data posted from a form to a hierarchy of domain objects.
For exampe, my form includes the following information:

Person first name
Person last name
Company name
Company address

I would like a javabean hierarchy, whose root is an object of type Person,
and which allows me do the following:

person.getFirstname();
person.getLastname();
person.getCompany();
person.getCompany().getAddress()

The last line is the crucial bit. It indicates that I require mapping of the
form data to a nested object model. Is there a component in Struts to do
this?

I expect there is, but have so far been unable to find it.

Thanks for your help,
Mike




--
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>