aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes page 416 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "page 416" Watch "page 416" New topic
Author

page 416

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 385
<jsp:useBean id="person" type="foo.Employee">
<jsp:setProperty name="person" property="name" value="fred" />
</jsp:useBean>

What happens if the servlet code looks like;
foo.Person p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person", p);

This is the question on page 416 of HFS

My questio is, that in usebean we mention type to be "foo.Employee"
but in servlet we have type foo.Person... is this not an error..

please reply


SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Amit Tayal
Ranch Hand

Joined: Apr 25, 2006
Posts: 51
Hi Shashank
Even though the reference type is Person in servlet but the object is of type of Employee.
So, you can mention reference type as Employee in usebean.

Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: page 416