JSP "items" does not support runtime expressions

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:forEach var="datatables" items="${ds}">
			<tr>
				<td>${datatables.engine}</td>
				<td>${datatables.browser}</td>
				<td>${datatables.platform}</td>
				<td>${datatables.version}</td>
				<td>${datatables.grade}</td>
			</tr>
</c:forEach>

In my JSP page, I import JSTL taglib like above, but it gives me the error that "items" does not support runtime expressions. The reason is previous taglib directive imports a JSTL 1.0 taglib. It should be JSTL 1.1 instead (note the difference in URI):

Solution: Change to the taglib

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  

Make sure you've imported jstl.jar in your project.
發佈了107 篇原創文章 · 獲贊 11 · 訪問量 33萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章