• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Iterate tag and TreeMaps

 
Elizabeth Reynolds
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code in a JSP page is returning a Java compiler warning (i.e., local variable myiterator1 is not used), although the code works fine.
Is there a better way to do this?

<UL>
<logic:iterate id="myIterator1" collection="<%= tempMap1 %>">
<LI><FONT size="2"><bean:write name="myIterator1" property="key" />
<bean:write name="myIterator1" property="value" /></FONT></LI>
</logic:iterate>
</UL>
tempMap1 is the result map from performing set operations and is obtained on the JSP page.
I believe the error refers to the "myIterator1" in the id field of the logic:iterate tag rather than the name field of the bean:write tag because I'm only getting one warning.
[ July 20, 2002: Message edited by: Elizabeth Reynolds ]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks referenced to me. I'd take a peek at the Java code produced by the JSP compiler (you may have to use a "keep generated" option on your appserver).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic