• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting loop index inside a jsp code  RSS feed

 
sarath krishna mandava
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.

 
Ryan McGuire
Ranch Hand
Posts: 1143
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66260
151
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!