my dog learned polymorphism*
The moose likes JSP and the fly likes jsp error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp error" Watch "jsp error" New topic
Author

jsp error

monis raza
Ranch Hand

Joined: Sep 05, 2011
Posts: 38












whinig over this error please some one help
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
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:



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp error