struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick" <nmoh...@adelphia.net>
Subject RE: nested bean parameters
Date Sun, 29 Jun 2003 09:55:51 GMT
Mike,

Are you still having a problem with this?  If so...looking at your
original JSP tags, I am sure that the problem is with your names not
matching up.  This is what needs to happen:

<logic:iterate id="alert" name="alertListForm" property="userAlerts"> 
  <bean:write name="alert" property="startingLocation.locationId" /> 
</logic:iterate>

In the object called "alertListForm", there must be a getter and setter
for "userAlerts": getUserAlerts() and setUserAlerts(Collection
userAlerts).  Those methods will return and accept a collection of
objects that in this case are LocationDTO's.

When you iterate, each object in the iteration will be known as an
"alert", so the property that you specify has to have a getter/setter.
In this case, your property should be "locationId".  Once again, insure
that you have the matching getter/setter methods: getLocationId() &
setLocationId(String locationId).

You do need to be careful with the capitalization.  We have found that
sticking to the java naming standard works best.  Defining a property
that begins with an uppercase throws Struts for a loop.

Hope this helps,
Nick




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


Mime
View raw message