Chapter 8: Scriptless JSPs
Page 357: I was wondering about this standard action/scripting:
<
jsp:setProperty name="person" property="name"
value="<%= request.getParameter("userName") %>" />
Why don't the nested double quotes (") cause a problem? Some sort of parsing error?
Page 356: Question 1 "Be the Container"
What happens if the
servlet code looks like this:
foo.Person p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person",p);
when the jsp standard action is:
<jsp:useBean id="person" type="foo.Employee" > [...]etc.
where foo.Person is abstract and foo.Employee is an extension of Person.
The explanation at the end of the chapter seems to indicate the problem is only with the scope of the "person" attribute. The servlet is apparently storing it at the request scope. The standard action has a page scope by default.
I thought that even if the jsp had scope="request" that it would fail since the real problem is that there is no object of type foo.employee out there. There is a class, but not a type. The type that is known is foo.Person.
Can anyone out there clarify this for me?
Thanks!
The answer to this question says