Computer Certification

  1. Home
  2. Computing & Technology
  3. Computer Certification
IBM J2EE Practice Test
20 Free IBM Practice Questions for the 484 Exam

Answer 6

Correct answer: b

Explanation:

If we use the type attribute without the class or beanName attributes, it attempts to locate an existing bean object of the given type, but does not create a new instance even if an existing instance is not available.

For example,

<jsp:useBean id=”person” type=”PersonBean” scope=”session” />

In this case, if the located object is not PersonBean or a subtype of it, a ClassCastException is thrown. If the object could not be located in the specified scope at all, no new object is created and InstantiationException is thrown.

Choices A, D and E are incorrect because in these cases, a new instance is created if an existing instance is not found. Choice C is invalid because beanName cannot be used alone in the jsp:useBean action.

Next page > Question 7

Explore Computer Certification

About.com Special Features

Computer Certification

  1. Home
  2. Computing & Technology
  3. Computer Certification

©2009 About.com, a part of The New York Times Company.

All rights reserved.