Information Technology Reference
In-Depth Information
requests using HTTP. An EJB communicates with other Java components
using the Remote Method Invocation over Internet Inter-ORB Protocol
(RMI-IIOP). According to J2EE 1.4 specification, the J2EE applications are
required to access EJB through RMI-IIOP. Servlet can respond to HTTP com-
mands, such as HTTP-POST and HTTP-GET. Following the J2EE specifica-
tion, EJB should not interact directly with the Web browser. The one Web
interaction allowed for EJB under J2EE specification is SOAP/HTTP protocol
for Web Services. Because of the differences in the container, Servlet resides
on the Web server that has the Servlet container, while EJB resides on the
application server that has the EJB container. Other than that, both the Web
and EJB containers provide similar services.
Because of the similarities of these two component models,
some software vendors developed their products purely using
Servlet technology. The advantage of this approach is their
products can be run on any Web server that supports a Servlet
container. This minimizes the system footprint necessary to run their
products. Web servers are originally designed to serve static content
that does not require high-performance and distributed computing
features. However, most Web servers that support Servlet containers
are now offering high-performance features such as failover, cluster-
ing, and load balancing. Increasingly, the main difference between the
Web server (that supports Servlet container) and the application server
(that supports EJB container) is the support for integration with other
systems and platforms.
In traditional Java programming paradigm, the Web components and EJB
play distinct and complementary roles. How should the Web components
interact with EJB components? JSP, Servlet, and EJB are created to work in
conjunction with the Model-View-Controller (MVC) programming model.
The MVC design paradigm separates an interactive application into three
modules: model, view, and controller. The model module is the application
logic and data. It is the heart of the application processing and corresponds
to the application and data layer in the traditional three-layer application
architecture. The view component is the presentation to the user. Typically,
in a Web program, this component would contain the Web pages that are
displayed to the users. The controller component is the link between the
model and the view; it dispatches the requests from the views to the model
and mediates the application flow. The controller functions similar to the
ORB—both the ORB and the controller take requests from the client, dis-
patch the requests to the receiver, and return the results to the client. Because
of the interactive nature of Web applications, following a request, the con-
troller performs the additional task of selecting and synthesizing the view
 
Search WWH ::




Custom Search