Java 2 Enterprise Edition (J2EE)
Java 2 Enterprise Edition (J2EE)
The J2EE platform uses a multitiered distributed application model. Application logic is
divided into components according to function, and the various application components that
make up a J2EE application are installed on different machines depending on the tier in the
multitiered J2EE environment to which the application component belongs. Figure 1-1 shows
two multitiered J2EE applications divided into the tiers described in the following list. The J2EE
application parts shown in Figure 1-1 are presented in J2EE Components.
Although a J2EE application can consist of the three or four tiers shown in Figure 1-1,
J2EE multitiered applications are generally considered to be three-tiered applications because
they are distributed over three different locations: client machines, the J2EE server machine, and
the database or legacy machines at the back end. Three-tiered applications that run in this way
extend the standard two-tiered client and server model by placing a multithreaded application
server between the client application and back-end storage.
Figure 1-1 Multitiered Applications
J2EE COMPONENTS:-
J2EE applications are made up of components. A J2EE component is a self-contained
functional software unit that is assembled into a J2EE application with its related classes and
files and that communicates with other components. The J2EE specification defines the
following J2EE components:
Application clients and applets are components that run on the client.
Java Server and Java Server Pages (JSP) technology components are Web
components that run on the server.
Enterprise JavaBeans (EJB) components (enterprise beans) are business components
that run on the server.
J2EE components are written in the Java programming language and are compiled in the
same way as any program in the language. The difference between J2EE components and
"standard" Java classes is that J2EE components are assembled into a J2EE application, verified
to be well formed and in compliance with the J2EE specification, and deployed to production,
where they are run and managed by the J2EE server.
J2EE CLIENTS:-
A J2EE client can be a Web client or an application client.
WEB CLIENTS:-
A Web client consists of two parts: dynamic Web pages containing various types of
markup language (HTML, XML, and so on), which are generated by Web components running
in the Web tier, and a Web browser, which renders the pages received from the server.
A Web client is sometimes called a thin client. Thin clients usually do not do things like
query databases, execute complex business rules, or connect to legacy applications. When you
use a thin client, heavyweight operations like these are off-loaded to enterprise beans executing
on the J2EE server where they can leverage the security, speed, services, and reliability of J2EE
server-side technologies.
APPLETS:-
A Web page received from the Web tier can include an embedded applet. An applet is a
small client application written in the Java programming language that executes in the Java
virtual machine installed in the Web browser. However, client systems will likely need the Java
Plug-in and possibly a security policy file in order for the applet to successfully execute in the
Web browser.
Web components are the preferred API for creating a Web client program because no
plug-ins or security policy files are needed on the client systems. Also, Web components enable
cleaner and more modular application design because they provide a way to separate applications
programming from Web page design. Personnel involved in Web page design thus do not need to
understand Java programming language syntax to do their jobs.
APPLICATION CLIENT:-
A J2EE application client runs on a client machine and provides a way for users to
handle tasks that require a richer user interface than can be provided by a markup language. It
typically has a graphical user interface (GUI) created from Swing or Abstract Window Toolkit
(AWT) APIs, but a command-line interface is certainly possible.
Application clients directly access enterprise beans running in the business tier. However,
if application requirements warrant it, a J2EE application client can open an HTTP connection to
establish communication with a servlet running in the Web tier.
WEB COMPONENT
J2EE Web components can be either servlets or JSP pages. Servlets are Java
programming language classes that dynamically process requests and construct responses. JSP
pages are text-based documents that execute as servlets but allow a more natural approach to
creating static content.Static HTML pages and applets are bundled with Web components during
application assembly, but are not considered Web components by the J2EE specification. Server-
side utility classes can also be bundled with Web components and, like HTML pages, are not
considered Web components.Like the client tier and as shown in Figure 1-3, the Web tier might
include a JavaBeans component to manage the user input and send that input to enterprise beans
running in the business tier for processing.
Figure 1-3 Web Tier and J2EE Application
BUSINESS COMPONENT:-
Business code, which is logic that solves or meets the needs of a particular business
domain such as banking, retail, or finance, is handled by enterprise beans running in the business
tier. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it
back to the client program.
The web site development environment should also provide the facility for 'validating' user input.
With JavaScript, forms are a consideration in nearly every page you design. Capturing user
requests is traditionally done via a 'form'. So the web site needs to have facilities to create forms.
Text fields and textareas can dynamically change in response to user responses.
TOMCAT 6.0:-
Tomcat is a servlet container and Java Server Pages implementation it may be used stand
alone ,or in conjunction with several popular web servers .