• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Getting loop index inside a jsp code  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I wrote the below code to iterate through an array. I wanted to get the index value of the loop inside the jsp code which is inside the loop. Can you please let me know how to do this. Thanks in advance.

 
Ranch Hand
Posts: 1154
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand the question correctly, you need to do a out.println(splitAnswer[i]i) inside your loop.  You might also want to add some HTML so that the results are formatted nicely.
 
Author and ninkuma
Marshal
Posts: 66786
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using obsolete scriptlets rather than c:forEach as is used later in the JSP?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!