aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes mistake in assesment exam? 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 "mistake in assesment exam?" Watch "mistake in assesment exam?" New topic
Author

mistake in assesment exam?

JohnWilliam Fitz
Ranch Hand

Joined: Oct 13, 2008
Posts: 80
Hi.

The following question is from an scwcd assesment exam of a very large company we all know. I won't say who...

:::beginning of question::::
Given a JSP page with the line:

<jsp:useBean id="cust" type="test.beans.CustomerBean" scope="session" />

Which two occur? (Choose two.)
A> A CustomerBean instance is created if the attribute name cust is not found.
B> The session is searched for a CustomerBean stored as the attribute name cust.
C> The CustomerBean instance is populated with the values of the parameters in the request.
D> A CustomerBean instance is always created and stored in the session with the attribute name cust.
E> The CustomerBean identified by cust is located in the application and then stored in the session for later use.
::::end of question:::::

The answer they give is A and B. But I do not believe it is correct. I have tried to duplicate the behaviour myself and what I have found is if <jsp:useBean> includes the "type" attribute, and not the class attribute, a missing bean instance is NEVER created.

So I believe that only B is true.

Who is wrong? Me? Or this big company who I will not name?

Thanks!
John
Zulfikar Dharmawan
Ranch Hand

Joined: Feb 01, 2002
Posts: 74
Hi,

I agree with you. I've tried that myself, it doesn't create a new bean.
There is also an excerpt from HFSJ:
'If type is used without class, the bean must already exist.
If class is used (with or without type) the class must NOT be abstract, and must have a public no-arg constructor.'


Zulfikar Dharmawan
SCJP1.4, ICS DB2, ICD Websphere
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mistake in assesment exam?