• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem coming while using c:forEach tag

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI

I am using struts 1.2 and using the following loop :

<c:forEach var="abcd" begin="1" end="5">
${abcd}
</c:forEach>

in actual the output should be 1,2,3,4,5

But in my case it is printing "${abcd}" 5 times.

Could you please tell me that what mistake i am doing and what should i do to rectify this.

Regards
Gaurav
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your web container is not compliant with the JSP 2.0 spec or above, you will need to write:

<c:forEach var="abcd" begin="1" end="5">
<c:out value="${abcd}" />
</c:forEach>
[ February 06, 2006: Message edited by: Merrill Higginson ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic