This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 63

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
 
Similar Threads
problem in using validator framework with multiple screen jsps
org.apache.jasper.JasperException: java.lang.ArrayIndexOutOfBoundsException: 8
Can you find the bug in <div> I do NOT get sample xml data[bookrss.xml]... RSS Client/Server
sending/retrieving data via SQL statements...
Problem with syntax?