• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

JSTL help - forEach

 
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.
 
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!
 
I'm doing laundry! Look how clean this tiny ad is:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic