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 doubt about jsp:useBean 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 "doubt about jsp:useBean" Watch "doubt about jsp:useBean" New topic

doubt about jsp:useBean

Victor Maehira
Ranch Hand

Joined: Mar 08, 2007
Posts: 37
Good morning!
I was solving a mock, when I faced the following question:

A JSP page needs to instantiate a JavaBean to be used by only that page. Which two jsp:useBean attributes must be used to access this attribute in the JSP page? (Choose two)
A. id
B. type
C. name
D. class
E. scope
F. create

The answer is B! It is incorrect, firstly, because the question says "choose two"! Moreover, I believe the correct answer should be A and D.
The id and the class is enough to access the bean ONLY in that page. What do you think?
Ezhil S Alagesan

Joined: Aug 31, 2007
Posts: 3
Yes, your options seems to be correct. :roll:

'id' is a mandatory field.

Then 'class' and 'type' comes into picture.

Out of them 'type' cannot be used to instantiate a bean.

I can, But I won't
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
yes, and without the scope it wil ldefault to the page
I agree. Here's the link:
subject: doubt about jsp:useBean
It's not a secret anymore!