In your example you would have a nested JavaBean in your form with a get
accessor that retrieved a nested JavaBean with a definition something like
this:

private AddressBean mailingAddress = new AddressBean();

public AddressBean getMailingAddress();

The AddressBean would need to have getters and setters for a street
property. getStreet() and setStreet(String s).

When you submit the JSP, Struts would call the getMailingAddress() method to
return the nested javabean and then Struts would invoke setAddress and pass
in the data from the input text field. 

You would use this Struts feature if you have JavaBean already and you don't
want to duplicate all of its accessors in the form bean. Or if you want to
be able to pass the data in one JavaBean to a model component but you don't
want to pass Struts objects to your model components. 

Hal

-----Original Message-----
From: Shamdasani Nimmi-ANS004 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 7:15 PM
To: '[EMAIL PROTECTED]'
Subject: How does nested syntax in property attribute work


Hi,

In some of the e-mails I have seen nested syntax being used for property
attribute, e.g.,

<html:text property="mailingAddress.street"/>

what does that mean? Is it that the getMailingAddress() method of the bean
will be called, and then what is ".street" for?

-Nimmi

Reply via email to