aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes page 356  HSFJ 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 356  HSFJ" Watch "page 356  HSFJ" New topic
Author

page 356 HSFJ

abhishek tiwari
Greenhorn

Joined: Aug 08, 2005
Posts: 19
hi guys,
i have the following doubt from HSFJ(Page number 356):-

servlet code

foo.Employee p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person",p);

standard action

<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"/>

Output is Name is Evan

the person attribute is stored in the request scope in the servlet code whereas the standard actions looks for it in the default scope i.e the page scope.so don't you think we should have a compile time error.

kindly solve my problem at the earliest

thanks in anticipation


when the going gets easy,you are going downhill.......<br /> <br />abhishek tiwari<br />scjp 93%<br />scwcd in progress
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
You are correct. That attribute shoild not be available to the JSP, since it's using the default scope of "page". It's probably a typo in the book.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Edmund Yong
Ranch Hand

Joined: Nov 16, 2003
Posts: 164
It is an error. Check the errata.


SCJP 1.2, SCWCD 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: page 356 HSFJ
 
Similar Threads
HFSJ doubt :Pg:356
Whats the error???
doubt in page 356 of HFSJ
Head First Servlets and JSP:SCWCD Question
Is this an error in HFSJ ??