Hi All, I have a list with several inherited objects so the List is defined with the parent object (it's defined as abstract) as parameter. In the prepare() method of the action I retrieve from DB all the child objects and I add them to the List<Parent> list. It works ok until I use that list in a select tag. Then it throws a npe exception. What am I doing wrong?
how are you using the list in the jsp? Some code might help
posted 5 years ago
Hi I think I use the list as usual:
Ejercicio is the parent class (abstract) and child classes are Estiramientos, Pesas, Progresivos, Serie, CarreraContinua, CambiosRitmo.
List<Ejercicio> listaEjercicios is the parent's objects list containing all child objects. I have split in several child's lists just as a matter of retrieving listaEjercicios sorted by the child's type.