In Class1 , we have a method doGetand a method that returns a list with objects of type Animal.
public List<Animal> getAnimals()
so I call a method like:
List<Animal> animal = getAnimals();
request.setAttribute("animal_list", animal);
In class 2 , I have a doGet method and I want to take animal_list. My code is:
List<Animal> list500=request.getAttribute("animal_list");
but when I compile, I get a message
"Object cannot be converted to List<Animal>"
nancy source
share