Hi All,
Plz clarify my doubt for the following question.
<
jsp:usebean id="person" type="foo.employee">
<jsp:setProperty name="person" property="name" value="fred"/>
</jsp:usebean>
<jsp:getProperty name="person" property="name"/>
1)foo.person p = new foo.employee();
p.setName("Evan");
request.setAttribute("person",p);
2)foo.employee p = new foo.employee();
p.setName("Evan");
request.setAttribute("person",p);
In HFSJ,it is given that the first
servlet & JSP pair wont work because usebean action will search the "person" in page scope since the scope attribute is missing in the usebean action and it defaults to "page".
Whereas the actual "person" object available only in request scope.I totally agree with this.But it is also given that the third servlet & JSP pair will work & print "Evan".How it is possible?.Here also "person" is set in the request scope & it should also fail right?.I dont understand the difference.Would request someone to clarify.
Thanks in advance..
Regards,
Priya.