All the jstl tags which do not involve passing back a value using Apache TagExtraInfo (Tei) are working, but whenever I use a tag like <c:forEach v开发者_JAVA技巧ar="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
**
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.
精彩评论