Hi Ranchers,
Please refer Pg 356 ( Be the container )
<
jsp:useBean id="person" type="foo.Employee">
<jsp:setProperty name="person" property="name" value="Fred" />
</jsp:useBean>
What would happen in JSP if the
servlet code looks like this
Person is the superclass of Employee
1) foo.Person p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person",p);
2) foo.Person p = new foo.Person();
p.setName("Evan");
request.setAttribute("person",p);
3) foo.Employee p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person",p);
My basic question is that since there is no scope specified in JSP , page is the default scope. But in all the 3 servlet snippets we are placing the attribute in request scope.
So in all the three cases JSP will not be able to find the bean. But the answer in the book says something else.
Any thoughts ??
[ April 27, 2006: Message edited by: Vivek Pandey ]