File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

page 356 HSFJ

abhishek tiwari

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();

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 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: 1510
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.

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:
subject: page 356 HSFJ
It's not a secret anymore!