Now, the HFSJ said that the result is
"FAILS at request time! The “person” attribute is stored at request
scope, so the <jsp:useBean > tag won’t work since it specifies only a
type. The Container KNOWS that if you have only a type specified,
there MUST be an existing bean attribute of that name and scope."
so i replicated it but i am not getting a failure at request time. can somebody enlighten me why?
Anyways for your reference, foo.Person is an abstract class while foo.Employee is a concrete class of foo.Person
If you go to the jsp without visiting the servlet first you will not have a "person" attribute in request scope, and so the jsp will throw an exception at that point.
It can't instantiate the bean without the "Class" attribute as it doesn't know which type to instantiate.
If you go via the servlet, and put a person into request scope, the page should work fine.