Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying a variable that i have declared and in scriptlet

 
bhavin ragha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to display the variable scoreTot. but in the html bit. im using JSP. but i get an error message.

my code below connects to a database and puts the element data in an array list.
then each element is checked if a certain string in the same. if it is then 1 is added to scoreTot.
in the html bit i want to display the scoreTot but i get an error message.

the error message is:
exception
org.apache.jasper.JasperException: java.lang.IndexOutOfBoundsException: Index: 5, Size: 5

root cause
java.lang.IndexOutOfBoundsException: Index: 5, Size: 5

 
Neeraj Dhiman
Ranch Hand
Posts: 68
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use scriplet in you jsp never ever ever. use servlet for your java code.
your exception says all. " ans.get(5)" does not present in your arraylist.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic