• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL forEach for ArrayList(collection in general)

 
Bhushan Jawle
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been trying to use c:forEach as
<c:forEach var="errMsg" items="${newBean.errorList}">
<c ut value="${errMsg}">
</c:forEach>
where newBean is an id of a bean with errorList as ArrayList, but it gives an error of not being able to access property for 'items' i.e ${newBean.errorList}.
Is the syntax OK ?(all non-collection properties of bean work fine)
Any help is appreciated.
Regards,
Bhushan
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The syntax looks o.k. for me.
I would try s.th. like
<%=newBean.getErrorList()%>
what do you get?
 
Bhushan Jawle
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Axel. I think the syntax was OK just that the bean was a bit messed up.Thanks for your answer anyway.
Regards,
Bhushan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!