The exercise in the HFSJ book is as follows
The STANDARD ACTION:
<
jsp:useBean id="person" type="foo.Employee" >
<jsp:setProperty name="person" property="name" value="Fred" />
</jsp:useBean>
SERVLET CODE:
foo.Employee p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person", p);
Question: What will the output for this be
<jsp:getProperty name="person" property="name" />
Answer in Book: The book states that this work fine and prints out Evan. The code inside the body of <jsp:useBean> will never run, since we specified a type without class.
I FEEL: IT SHOULD FAIL AT REQUEST TIME cos when the scope is not mentioned in the useBean tag, so it defaults to the page scope. When only the type is mentioned in the useBean tag there should be an existing attribute bean with the same name and scope. Here the scope is not same. The attribute bean exists in the request scope. The tag is searching in the page scope
The book anyhow contradicts the answer by saying when only the type is mentioned in the useBean tag there should be an existing attribute bean with the same name and scope
JAVARANCH GUYS PLEASE HELP....
Regards
Thomas