Multiple choice technology programming languages

You want to locate an existing bean object but do not want to create a new instance, if an existing instance is not available. Which of the following bean attributes will you use in the jsp:useBean action?

  1. class

  2. type

  3. beanName

  4. class and type

  5. beanName and type

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When you use only the type attribute in jsp:useBean (without class or beanName), the container will look for an existing bean with the specified scope and type. If no existing bean is found, no new instance is created. This prevents instantiation when you only want to reference existing beans.