Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsp Exception while iterating through the arraylist using itearator  RSS feed

 
neelima bluema
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a arraylist of objects,and i have to diaplay them in a jsp page.I am using the iterator ..the code of JSP follows



And when i am farwarded to this page it's giving me exception--->NOSUCHELEMENTEXCEPTION

Plese help me on this
Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd advise to stop using obsolete Java scriptlets and employ the modern JSTL and EL.
 
Mazen Mahmoud
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As mentioned, you should go for JSTL/EL rather then using scriptlets. Anyhow, you are calling iterator.next() in every <td> which should not be the case. You should iterate per
row and read members one by one.

Regards
 
neelima bluema
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestions.

I found the problem.I am getting that exception due to while loop,it's keep on checking ..so by reaching the end it's still checking that's why i was getting that exception.
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!