开发者

JSTL Tei Not Working

开发者 https://www.devze.com 2023-01-03 23:41 出处:网络
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%><

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消