tags:

views:

20

answers:

1

All the jstl tags which do not involve passing back a value(using tei) are working, but whenever I use a tag like <c:forEach var="abc">...<%=abc%></c:forEach> i am getting an error abc cannot be resolved.


<c:forEach var="i" begin="0" end="<%=len%>">
<%str+=" Parameter type= " + (String)(tArray[i]) + " Parameter Value= "+ pArray[i];
logger.info(str);%>
</c:forEach>

Generates:

**

An error occurred at line: 54 in the jsp file: /jsp/testutility/JMX/invoke.jsp i cannot be resolved

**

+1  A: 

That's because it's not the correct way to do it, you should be doing this instead:

<c:forEach var="abc">
   ${abc}
</c:forEach>

<%=abc%> and ${abc} are not the same thing. The first form is an old-style JSP scriptlet, the latter style is JSP Expression Language (EL), which works with JSTL.

skaffman