Application components. The J2EE programming model defines four application component types that a J2EE product must support:
- Application clients are Java programming language programs that are typically GUI programs that execute on a desktop computer. Application clients offer a user experience similar to that of native applications, and have access to all of the facilities of the J2EE middle tier.
- Applets are GUI components that typically execute in a web browser, but can execute in a variety of other applications or devices that support the applet programming model. Applets can be used to provide a powerful user interface for J2EE applications. (Simple HTML pages can also be used to provide a more limited user interface for J2EE applications.)
- Servlets and JSP pages typically execute in a web server and respond to HTTP requests from web clients. Servlets and JSP pages may be used to generate HTML pages that are an application's user interface. They may also be used to generate XML or other format data that is consumed by other application components. Servlets, and pages created with the JavaServer Pages technology, are often referred to collectively in this specification as "web components." Web applications are composed of web components and other data such as HTML pages.
- Enterprise JavaBeans (EJB) components execute in a managed environment that supports transactions. Enterprise beans typically contain the business logic for a J2EE application.
These application components can be divided into three categories:
- Components that are deployed, managed, and executed on a J2EE server. These components include JavaServer Pages, servlets, and Enterprise JavaBeans.
- Components that are deployed and managed on a J2EE server, but are loaded to and executed on a client machine. These components include HTML pages and applets embedded in the HTML pages.
- Components whose deployment and management are not completely defined by this specification. Application clients fall into this category. Future versions of this specification may more fully define deployment and management of application clients.
Containers. Containers provide the runtime support for the application components. A container provides a federated view of the underlying J2EE APIs to the application components. Interposing a container between the application components and the J2EE services allows the container to transparently inject services defined by the components' deployment descriptors, such as declarative transaction management, security checks, resource pooling, and state management. A typical J2EE product will provide a container for each application component type: application client container, applet container, web component container, and enterprise bean container.
This specification requires that these containers provide a Java Compatible runtime environment, as defined by the Java 2 Platform, Standard Edition, v1.2 specification (J2SE). The applet container may use the Java Plugin product to provide this environment, or it may provide it natively. The use of applet containers providing only the JDK 1.1 APIs is outside the scope of this specification.
The container tools also understand the file formats for packaging of the application components for deployment. The containers are implemented by a J2EE product provider.
This specification defines a set of standard services that each J2EE product must support. These standard services are described below. The J2EE containers provide the APIs to access these services to application components. A future release of this specification will describe standard ways to extend J2EE services with connectors to other non-J2EE application systems, such as mainframe systems and ERP systems.
Underlying the J2EE containers is the J2EE core. A J2EE product provider typically implements the J2EE server core using an existing transaction processing infrastructure in combination with Java 2 technology. The J2EE client core is typically built on Java 2 Platform, Standard Edition technology.