JSP scriptlets, expressions, and declarations provide you with a way to access JavaBeans.

The jsp:useBean action gives you the ability to create JavaBeans, and the jsp:getProperty and jsp:setProperty actions allow you to manipulate bean properties. When you want to use a JavaBean within a JSP, use the jsp:useBean action to either create a new instance of the bean or to use an existing bean. When you encapsulate business objects or business logic into a Java class, you should make that Java class a bean. Many of Sun's Java APIs and tools revolve around the idea that you put your logic into beans and then use tools to help you create applications that use those beans. JSP is one of those tools. When you add a bean to a JSP, you can either create a new bean or use an existing one. The JSP engine determines whether it needs to create a new bean for you based on the bean's ID.

When you add a bean to a page, you must at least give the bean an ID, which is just a name and the bean's class, like this:
<jsp:useBean id="myBean" class="examples.TestBean"/>

The JSP engine first searches for an existing bean with the same ID (myBean in this case). If it doesn't find an existing bean, the JSP engine creates a new instance of the class you specified. One of the other options you can use in the jsp:useBean element is scope. The scope determines where the JSP engine stores a created bean and also where it looks to see whether a particular bean ID already exists. A bean can have a scope of page, request, session, or application. If you do not specify a scope for a bean, the default scope is page. A bean with request scope is visible to other JSPs and servlets and is stored in the request object.