abstract class Person
concrete class Employee
Look at this standard action:
Question 1: What happens if the servlet code looks like:
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.
How can that JSP code fail at request time, if the servlet sets the attribute "person" in the request scope? Isn't foo.Employee the type of the attribute"person"? Or is it foo.Person? I'm confused.
Joined: Nov 27, 2010
I think the authors meant that <jsp:setProperty> can't be used because the bean already exists at request scope. I could be wrong. (Why would the request fail if <jsp:setProperty> can't run?). Still looking for answers.