I have trouble to access a specific object inside a List based on a key.
Before the first page, I load all the objects(meetings) into a list and only
show the name of the meeting to the user. By following the link (with id as
parameter), user goes to the next page. Based on the id, I want to show the
detail of the object (meeting). For my current implementation, I have to
iterate through every single object in the list and try to match the key. It
works, but pretty stupid. Is there a better way to do it? Or should I use
Hashmap (keyed by id) at the very beginning instead?
Also, to use logic:iterate, is there something like a "break"?
Thanks!
ds
First page:
<logic:iterate id="m" name="meetings">
<li>
<html:link
forward="showMeeting"
paramId="id"
paramProperty="id"
paramName="m">
<bean:write name="m" property="name"/>
</html:link>
</li>
</logic:iterate>
It will build:
http://myproject/showMeeting?id=1
Second Page:
<logic:iterate id="row" name="meetings">
<logic:equal name="row" property="id" value="<%=request.getParameter
("id")%>">
<tr>
<TH align="right" width="50%">Meeting Name:</TH>
<TD align="left"><bean:write name="row" property="name"/></TD>
</tr>
...
</logic:equal>
</logic:iterate>
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]