To locate or instantiate the bean <jsp:useBean> takes the following steps in this order:
Given answer:
1. if it finds the bean, stores a reference to it in the variable.
2. if it does not find the bean , instantiate it from the class you specify storing a reference to it in the new variable.
3. Attempts to locate a bean with the scope and name.
4. Defines an object reference variable with the name.
Explanation:
The <jsp:useBean> element locates or instantiates a JavaBeans component. <jsp:useBean>
first attempts to locate an instance of the bean. If the bean does not exist, <jsp:useBean> instantiates it from
a class or serialized template.
To locate or instantiate a bean, <jsp:useBean> takes the following steps in this order:
1. attempts to locate a bean with the scope and name you specify.
2. defines an object reference variable with the name you specify.
3. if it finds the bean, stores a reference to it in the variable. if you specified type, gives the bean that type.
4. if it does not find the bean, instantiate it from the class you specify, storing reference to it in the new variable. If the
class name represents a serialized template, the bean instantiated by java.beans.Benas.instantiate.
5. if <jsp:useBean> has instantiated (rather than located) the bean, and if it has body tags or elements (between <jsp:useBean>
and </jsp:useBean>, execute the body tags.
The given answer and the explanation is different. I believe the explanation is correct.