JSP "items" does not support runtime expressions

来源:互联网 发布:p2p软件开发 广州 编辑:程序博客网 时间:2024/06/09 04:44
<%@ 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.