aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFS: ambiguity in coffee cram ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFS: ambiguity in coffee cram ?" Watch "HFS: ambiguity in coffee cram ?" New topic
Author

HFS: ambiguity in coffee cram ?

Neil Mc
Ranch Hand

Joined: Oct 20, 2003
Posts: 32
Hi,

In the coffee cram for ch 8 question 11 (regarding the <jsp:useBean> std action) there seems to be an ambiguity...

Answer D is given as correct i.e. the statement... "Either the class or type attributes may be specified, but at least one" is given as true.

However, in the bullet point section (pg 414) it states that "the class attibute is optional" (and makes no mention of the type attribute). This makes sense as, in the case where the Bean already exists as an attribute, neither the class or type attributes are required - as the container does not need to create a new object.

The coffee cram answer and the bullet point seem to conflict with each other.

So, which is the case... is 'id' the only required attribute in <jsp:useBean> ?

Thanks for your time,

Neil.
Colin Fletcher
Ranch Hand

Joined: Sep 10, 2004
Posts: 200
Neil,

I understand the useBean attribute like this:

useBean id type|class ...

The attribute id is required.
Either the attribute type of class is required.

Do you know what the significance of using the type or class attribute is ?


SCJP 1.4 SCWCD 1.4
Neil Mc
Ranch Hand

Joined: Oct 20, 2003
Posts: 32
Yup - Polymorphic references.

The spec seems to say that class can only be ommitted if 'type' is included (i.e. and attribute already exists).

The bullet points on page 414 say "The 'class' attribute is optional". This isn't strictly true and is at best ambiguous on this point.
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Yes, the bullet point is ambiguous; you're right. While it is *true*--the attribute IS optional--as you said, it's only optional under the condition that "type" is supplied!

Good catch, and the early statement in the book is exactly how to interpret it (and folows the way it is described in the spec and the exam).

cheers,
Kathy
Neil Mc
Ranch Hand

Joined: Oct 20, 2003
Posts: 32
Again, thanks Kathy.

Don't think I've ever read a book where the authors are so readily on-hand to answer queries.

Top notch support
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFS: ambiguity in coffee cram ?