Entering content frame

Background documentation Java Beans Locate the document in its SAP Library structure

Java Beans referenced in JSP must be accessible at compilation time and at execution time. This is achieved by packaging the beans into the lib or classes directory of the PAR file.

Passing a Java beans to the JSP page can be achieved by storing the beans in the request.

The jsp:useBean action associates an instance of a Java programming language object, which was defined within a given scope and is available with a given ID, with a newly declared scripting variable of the same ID.

This graphic is explained in the accompanying text

<jsp:useBean id="name "scope="page|request|session|application" typeSpec >

    body

</jsp:useBean>

The jsp:useBean action is quite flexible; its exact semantics depend on the attributes given. The basic semantic tries to find an existing object using id and scope. If the object is not found, it will attempt to create the object using the other attributes. The JSP semantics is respected when a JSP page is translated to a portal component.

However, the name spacing associated to the application scope is modified and is associated to the context of the portal component:

This graphic is explained in the accompanying text

<jsp:useBean id="foo" scope="page" class="beans.checkbox.CheckTest" />

When the application scope is used, the bean’s instance is stored in the context of the component that is using the JSP page that contains the useBean directive.

Scopes Description

Scope

Accessibility

Refence Storages

page

Accessible only within the page where they are created

In the pageContext object

request

Accessible from pages processing the same request where they were created

In the request object

session

Accessible from pages processing requests that are in the same session as the one in which they were created

In the PortalComponentSession object associated with the page activation

application

Accessible from pages processing requests that are in the same application as the one in which they were created

In the component context associated of the portal component that activates the page. All references to the object shall be released when the runtime environment reclaims the PortalComponentContext

 

 

Leaving content frame