*
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
Author

doubt about jsp:useBean

Victor Maehira
Ranch Hand

Joined: Mar 08, 2007
Posts: 33
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?
Thanks!
Ezhil S Alagesan
Greenhorn

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doubt about jsp:useBean
 
Similar Threads
Whizlabs Mock Question
question on jsp:useBean
question on el and standard action
Doubt in mocktest
Please answer me this question.