I have this code
<c:forEach var="l" value="${logs}">
...
</c:forEach>
and it says:
Attribute value invalid for tag forEach according to TLD
The forEach
tag does not support the value
attribute. I.e. the <c:forEach value>
is not recognized. Really, that's basically what the error is trying to tell you.
If you consult the documentation of the forEach
tag, then you'll see that the value
attribute is indeed not mentioned in the attributes table. Only the following attributes are listed:
items
- Collection of items to iterate over.begin
- If items specified: Iteration begins at the item located at the specified index. First item of the collection has index 0. If items not specified: Iteration begins with index set at the value specified.end
- If items specified: Iteration ends at the item located at the specified index (inclusive). If items not specified: Iteration ends when index reaches the value specified.step
- Iteration will only process every step items of the collection, starting with the first one.var
- Name of the exported scoped variable for the current item of the iteration. This scoped variable has nested visibility. Its type depends on the object of the underlying collection.varStatus
- Name of the exported scoped variable for the status of the iteration. Object exported is of type javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility.
Guess which one you actually need. In case you're unsure, the Java EE tutorial may help.