Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL help - forEach  RSS feed

 
vivek ja
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:forEach var ="movie" items="${moviesString}" varStatus="movieLoopCount">
<tr><td>$(movie}</td></tr>
<tr><td>$(movieLoopCount.count}</td></tr>
</c:forEach>

when i do this its printing ${movie} 3 times in the browser. Its not printing the value, same is happening for the count also.
Am setting the values of the string array in the servlet.
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
$(movie} should be ${movie}
$(movieLoopCount.count} should be ${movieLoopCount.count}

( shoud be replaced by {
 
vivek ja
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yes, overlooked that, thanks for pointing that out!
I guess that was really silly!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!