struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "apachep2" <apach...@hotmail.com>
Subject RE: Iterating through a Map collection of Beans
Date Thu, 06 Mar 2003 15:50:49 GMT
Location bean is made up of

Locationname
Locationcity
Locationcountry
And a Map, rooms

Rooms consist of 3 room beans

Room1name Room1description
Room2name Room2description
Room3name Room3description

Assume there is a session/request/page scope Object location. On JSP
page using struts,

<bean:write name="location" property="Locationname"/>
<bean:write name="location" property=" Locationcity"/>
<bean:write name="location" property=" Locationcountry"/>
<logic:iterate name="location" property="rooms" id="room">
	<bean:write name="room" property="roomname"/>
	<bean:write name="room" property="roomdescription"/>
</logic:iterate>

I suggest you study the struts-example came with struts source and
mokey/banana example in struts documentation.

-----Original Message-----
From: Paul Blundell [mailto:paulblundell@yahoo.com] 
Sent: March 6, 2003 10:37 AM
To: struts-user@jakarta.apache.org
Subject: Iterating through a Map collection of Beans

Does anyone have any examples of code for iterating through a Map
containing

The application is storing data related to a Location. A location can
contain several rooms, so on the form there will be fields such as:

Locationname
Locationcity
Locationcountry

Room1name Room1description
Room2name Room2description
Room3name Room3description

The room will be defined as a bean, the bean holding name and
description.
The Location will hold all the room beans in a Map.

Could anyone show me/point me at some example JSP and Java code which is
similar to what I am trying to do here

Thanks
Paul



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

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