• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp error

 
monis raza
Ranch Hand
Posts: 38
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator











whinig over this error please some one help
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64832
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At some point in the JSP you are trying to cast a String to an ArrayList, and obviously you can't do that.

Why is there Java code in the JSP? That's a practice that has been obsolete and discredited for 10 years. Please see this JspFaq entry.
 
Stefan Evans
Bartender
Posts: 1715
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is caused by this line:



What that method does is add all the items in the datalist to the polist.
What you seem to want is to add the datalist to the polist (ie end up with a list of lists)
in which case what you want is:



I would echos Bear's comments about java code in JSPs.
I would also suggest you come up with a better structure than a List of Lists.
Why not create a java bean to represent what you want, and return a list of them?


Here is the sasme page converted to using JSTL:



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic