Why are you doing this:
Iterator<List> it=b.iterator();
Shouldn't be Iterator<Data> it = b.iterator?
What's b? Is not defined anywhere.
Why do you use the iterator for a list? why not to use just a for(Data myData: request.getAttribute("b"))?
And the most important question... why to use
Java code in a JSP where you can use JSTL and EL and forget about iterators, casting, etc...?
Read about the JSTL:
http://java.sun.com/products/jsp/jstl/reference/docs/index.html
and the Unified Expression Language:
http://java.sun.com/javaee/5/docs/tutorial/doc/bnahq.html
You will see that this:
can be changed to much simpler code:
By the way in your Data class
you should have override the method toString, otherwise some strange
string will appear in your browser.