Contents
J2EE components
The J2EE Specification describes four types of components that can be created by a developer. Each component is a modular software unit that is deployed within the application server and interacts with its host environment and other components through the J2EE APIs that are available to it.
The APIs available to the components determine the facilities that the components have access to.
Oxxus .net features all servlet technologies. Check out the best java hosting provider on the internet.
Further description of the application components:
- Applet component
- These are client-side GUI components that are hosted by an applet container, which is typically a web browser. They have the ability to provide a feature-rich user interface to an enterprise application.
- Application client component
- These are Java-based programs that can execute within a supported JVM. They offer a user interface similar to what exists on the native client while accessing J2EE Business Tier facilities.
- Web component
- These are components that have the ability to respond to HTTP requests. They comprise servlets, JSP pages, filters, and web event listeners:
- Servlets
- These extend aweb server's functionality to support the dynamic processing of application logic. Servlets can be used in any request/response programming models but are most often used with HTTP. In this method, they utilize data embedded within HTTP requests for input and provide resulting output using the HTTP response, making the processing facilities of the J2EE Platform available to the information input on the source web page.
- JavaServer Pages
- Similar to servlets, JSP pages provide dynamic web application capability to the J2EE Platform. JSP pages achieve this goal through the introduction of templating functionality. A JSP page begins with HTML elements that remain static throughout the lifetime of the page; this forms the base template. Dynamic elements are then added through the embedding of Java code and/or special tags within the page. It should be noted that JSP pages are indeed converted to servlets before execution, but the intricacies of this process are managed by the web container.
- Filters
- These components provide the ability to intercept requests by clients for resources on a server and also responses provided to these requests by the web container with the goal of transforming the content of either the request or response communication. Filters provide a reusable mechanism to handle recurring tasks such as authentication, logging, etc., that are applicable to items within the web container.
- Web event listeners
- These are components that are created to perform a particular function when a specific event occurs within the web container. These components provide developers with the flexibility to respond in a certain way when different types of web application–related events such as the creation or invalidation of a session occurs.
- Enterprise JavaBeans components
- These are server-side components that singularly or collectively encapsulate the application logic of an enterprise application.
EJB technology enables rapid and simplified development of distributed, transactional, secure, and portable applications based on Java technology. There are three types of EJBs defined by the specification:
- Session beans
- A session bean is a server-side extension of a client that exists to service requests made by the client. As the name implies, it simulates an interactive session between a client and the server-based component. Session beans exist in two forms. There are stateful session beans, which are said to maintain a "conversational state" with a client by virtue of retaining instance variable data on multiple method invocations. Because of this, they are wedded to a unique client throughout the instance existence. Stateless session beans, on the other hand, exist to service requests from multiple clients. They perform transient services for their clients, fulfilling whatever request is made of them and returning to their original initialized states.
- Entity beans
- Entity beans are an encapsulated representation of business objects made available with a persistence mechanism. They represent an object to relational mapping of the data stored within these persistence layers, thereby facilitating the modification of the underlying business objects while preserving referential and data integrity constraints demanded by the specific business process.
- Message-driven beans
- These are stateless, server-side components invoked by the EJB container on the receipt of a message in an associated JMS Queue or Topic. This component allows the EJB container to provide support for asynchronous message processing.