Page 356 of HFS, states the following question
<jsp:useBean id="person" type="foo.Person">
<jsp:setProperty name="person" property="name" value="Fred"/>
</jsp:useBean>
Name : <jsp:getProperty name="person" property="name"/>
And the question # 3)
foo.Employee person = new foo.Employee();
person.setName("Evan");
request.setAttribute("person",person);
is said to give an output of "Evan" - the reason being that, control won't enter the body of useBean tag if type attribute is used.
When i tried the same example, the following is what i get
"javax.servlet.ServletException: bean person not found within scope" However, when i have the useBean tag as
<jsp:useBean id="person" type="foo.Employee" scope="request">
i get "Evan" as the output. I dont find a mention of this in Errata as well.
Am i missing something here?
Env :
Tomcat 5.0.30/Win XP