<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test</title>
</head>
<body>
<sql:query var="rs">
select * from posts
</sql:query>
<c:forEach var="row" items="${rs.rows}">
<c:out value="${row.post_id}" /><br />
<c:out value="${row.postname}" /><br />
</c:forEach>
<br>
</body>
</html>
複製代碼
執行後在 <c:forEach var="row" items="${rs.rows}"> 這行出現錯誤訊息如下:
According to TLD or attribute directive in tag file, attribute items does not accept any expressions