Hello,
I am trying to use JSTL foreach tag to iterate over a collection stored in a
java bean with application scope. I am getting a
jsp parse exception with the following error
string: Expression Language not supported in compile time attribute items on line
<c:forEach var="category" items="${reportMgr.reportCategories}" varStatus="status">
My understanding is that I can still use the jsp:useBean tag, set the object id in this tag and then refer to object id in the jstl tags via EL.
What am I missing?
thanks!
Here is the code snippet:
<jsp:useBean id="reportMgr" scope="session" class="oracle.emarket.dashboard.data.ReportManager">
<table width="100%" height="34" border="0" cellpadding="0" cellspacing="0">
<tbody>
<c:forEach var="category" items="${reportMgr.reportCategories}" varStatus="status">
<tr valign="top">
<td width="11" height="34" rowspan="2"><img height="34" alt="" src="imgs/hp_bar_leftside.gif" width="11" border="0"></td>
<td height="23" valign="middle" nowrap class="textB" background="imgs/hp_button_middle1.gif">
<a href="#" class="textB">
<span class="textB"> <c
ut value="${category}"/> </span>
</a>
</td>
<c:choose>
<c:when test="${fn:length(category) = status.count}">
<td width="21" rowspan="2"><img height="34" alt="" src="imgs/hp_button_side-right.gif" width="21" border="0"></td>
</c:when>
<c
therwise>
<td width="21" rowspan="2"><img height="34" alt="" src="imgs/hp_button_middle2.gif" width="21" border="0"></td>
</c
therwise>
</c:choose>
<td width="100%" rowspan="2" background="imgs/hp_test.gif"> </td>
<td width="1" rowspan="2" align="right" background="imgs/hp_bar_rightside.gif"><img src="imgs/hp_spacer.gif"></td>
</tr>
<tr>
<td background="imgs/hp_button_middle2.gif" width="125" height=11><img height=1 alt="" src="imgs/hp_spacer.gif" width=1 border=0></td>
</tr>
</c:forEach>
</tbody>
</table>