I have this struts code where I am using forEach-
<c:forEach items="${reviewList}" var="reviewListId">
<tr>
<td colspan="6" class="we_have"><c:out value="${reviewListId}" />
</td>
</tr>
I have added this taglib
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
But in place of forEach
tag showing an error that is-
According to TLD or attribute directive in tag file, attribute items does not accept any expressions
but in place of tag lib its not showing any error that means its supporting this tag lib but don't know why its not supporting forEach tag.
try <%@ taglib uri="http://java.sun.com/jsp/jstl/core prefix="c"%>
I am not knowing more about the issue without seeing the code but if its not working then another altenative which you may use is struts Iterator
Iterator will iterate over a value. An iterable value can be any of: java.util.Collection, java.util.Iterator
http://struts.apache.org/2.0.14/docs/iterator.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With