Thor
Thor

Reputation: 10028

jsp:useBean attributes official documentation

I'm a beginner at Java ee and I'm trying to learn how jsp works.

With the <jsp:useBean>, I want to learn a bit more about what are some of the different attributes available.

With a basic google search, I could easily find the oracle documentation on classes such as HttpServlet, HttpServletResponse etc. But searching the term jsp useBean documentation did not show up similar pages that are official oracle documentation.

I was just wondering, what is a good search strategy when I want to checkout the official Oracle documentation on JSP technology?

Upvotes: 1

Views: 541

Answers (1)

Ofisora
Ofisora

Reputation: 2737

You can check this documentation from oracle.

Contents from the provided link:

The <jsp:useBean> tag locates or instantiates a JavaBeans component. The <jsp:useBean> tag 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 the 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. If it finds the bean, stores a reference to it in the variable. If you specified type, gives the bean that type.
  3. If it does not find the bean, instantiates it from the class you specify, storing a reference to it in the new variable. If the class name represents a serialized template, the bean is instantiated by java.beans.Beans.instantiate.
  4. If <jsp:useBean> has instantiated (rather than located) the bean, and if it has body tags or JSP tags (between <jsp:useBean> and </jsp:useBean>), executes the body tags.

Syntax

<jsp:useBean id="beanInstanceName" scope="page|request|session|application"
{
 class="package.class" [ type="package.class" ]|
 beanName="{package.class |
 <%= expression %>}" type="package.class" |
 type="package.class"
}
{ /> | > other tags </jsp:useBean> }

Upvotes: 1

Related Questions