File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Expression Language not supported in compile time attribute items Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Expression Language not supported in compile time attribute items " Watch "Expression Language not supported in compile time attribute items " New topic
Author

Expression Language not supported in compile time attribute items

Rachel McNamara
Greenhorn

Joined: May 14, 2004
Posts: 5
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>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Which version of the JSTL, and if 1.0, which TLD are you using?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rachel McNamara
Greenhorn

Joined: May 14, 2004
Posts: 5
Thanks for your reply! I am using JSTL 1.0 core library with Oracle's oc4j version 10g, which uses standard.jar. I dont think i need to add a taglib in my web.xml but I tried it anyway (mapping to standard.jar and then to c.tld) and got a different error message that said foreach was not in the namespace...;-(
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Are you using the "c" or the "c-rt" tld file?
Rachel McNamara
Greenhorn

Joined: May 14, 2004
Posts: 5
thanks again for your reply - sorry i have been MIA and I hope you might still have an answer for me! I am using the c.tld....
Rachel McNamara
Greenhorn

Joined: May 14, 2004
Posts: 5
the c.tld is contained in the standar.jar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Expression Language not supported in compile time attribute items
 
Similar Threads
Multiple bundles broke my app(properties file)
JSTL when test problem
reg html tables
Selection Drop Down Question
problem updating quantity field