File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes displaying a variable that i have declared and in scriptlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "displaying a variable that i have declared and in scriptlet" Watch "displaying a variable that i have declared and in scriptlet" New topic
Author

displaying a variable that i have declared and in scriptlet

bhavin ragha
Greenhorn

Joined: Mar 28, 2012
Posts: 17
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

Joined: Dec 19, 2011
Posts: 66

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.


Correct Me if i am wrong
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: displaying a variable that i have declared and in scriptlet