An element type indicates the name and type of such variables although details on the name
of the variable may depend on the Scripting Language. The scripting language may also
affect how different features of the object are exposed; for example, in the JavaBeans
specification, properties are exposed via
methods, while these are available
The exact rules for the visibility of the variables are scripting language specific. Chapter 4
defines the rules for when the
attribute of the
directive is java .
Scripts, Actions, and Beans
Scripting elements, actions and Beans are all mechanisms that can be used to describe
dynamic behavior in JSP pages. Different authors and authoring tools can use these
mechanisms in different ways based on their needs and their preferences. The JSP
specification does not restrict their use but this section provides some guidelines that may be
useful to understand their relative strengths.
Beans are a well known and well supported component framework for the Java platform that
can be accessed easily from the Java programming language and other JSP page scripting
languages. Some JSP page authors, or their support organizations, may create or reuse Bean
components to use from their JSP pages.
Actions provide an abstraction that can be used to easily encapsulate common actions.
Actions typically create and / or act on (server side) objects, often Beans.
The JSP specification provides some standard actions that can be used to interact with any
Bean. If the Bean is extended so it implements the
interface, then the Bean becomes a
tag handler and it can be used directly in the JSP page with improved integration into the
Scripting elements are very flexible; that is their power but also their danger as they can
make hard understanding and maintain a page that uses them extensively; they may also
make it hard for an authoring tool. In some development contexts, JSP pages will mostly
contain only actions (standard or custom) with scripting elements only used as a gluing
mechanism that can be used to fill in the actions that are described using actions (and
Beans and EJB components). In other development contexts JSP pages may contain
significant amounts of scripting elements.
JSP, HTML, and XML
The JSP specification is designed to support the dynamic creation of several types of
structured documents, especially those using HTML and XML.
JavaServer Pages 1.1 Specification November 30, 1999