Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL help - forEach

 
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!