Hi,
Regarding "BE the Container " in pg 356 of Head First Book.
which states that
What will happens if the
servlet code looks like
foo.Employee p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person",p);
and the Standard action in
JSP is
<jsp:useBean id="person" type="foo.Employee" >
<jsp:setProperty name="person" property="name" value="Fred" />
</jsp:useBean>
Name is : <jsp:getProperty name="person" property="name" />
and the answer provided in pg 416 is
Ans : This works fine and prints out "Evan".Remember,the code
inside the body of <jsp:useBean> will Never run,since we specified a type without a class
But when i incorporated the same logic in
Tomcat version 5.0
I get a java.lang.InstantiationException:beann person not found ...
But when i change the action tag as
<jsp:useBean id="person" class="foo.Employee" >
it's working fine.
So is the answer in Pg 416 is wrong or am i missing out something.
Please help
Regards
V.Parsuvanath.