I have the following servlet code which does some work and forwards the request to the above JSP:
foo.Person p = new foo.Employee (); p.setName("John"); request.setAttribute("person",p);
Now, this scenario is supposed to fail (as explained in Head First Servlets and Jsp book, Chapter is Scriptless Jsp). Can someone please explain to me why should it fail ? If we use only the type attribute the bean should already exist and I think the following line is doing that : request.setAttribute("person",p);
SCJP 80% SCWCD 89%
posted 12 years ago
Just to add to my question "Person" is an abstract class and "Employee" is a non-abstract class.