Hello All,
I am reading the book Head First
Servlets and
Jsp. I came across the following useBean question in "scripless jsp" chapter.
jsp looks like (only relavant code is given)
foo.Person is abstract class
1) what happens if the servlet code looks like this
given answer: fails at request time
2) what happens if the servlet code looks like
given answer: sucess and prints "name is evan"
i don't understand the 2nd answer. The person attribute has request scope. As useBean didn't mention any scope page scope is considered as default.
Then 2nd scenario also should fail. Am i right?
In the 1st case object is of type Person. It won't match with the type attribute(foo.Employee) of useBean tag. Suppose if scopes match will this work.
Thanks,
Venkat