



























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




























๏^ The^ application
server
maintains
control
and^ provides
services
through
an^ interface
or^ framework
known
as^ a
container ๏ J2EE^ application
components
use^ the
protocols and
methods of
the^ container
to^ access
other^
application
components
and^ services
provided
by^ the
server.
๏^ Contract
specifies
how^ components
should^ be
developed
and^ deployed. ๏ How^ components
can^ access
services^
provided
by
container. ๏ Interfaces
and^ Classes,
developer
writes^ the
classes^ that
implements
this^ interfaces. ๏^ Extends
the^ classes
and^ provides
appropriate
implementation
of^ various
methods
and^ rest^
will^ be
done^ by^ container. ๏ Container
takes^ the
responsibility
of^ instantiating,
initializing
and^ invoking
the^ components.
Application
does^ not^
directly^ instantiate
or^ invokes
components.
๏^ Server
itself^ Provide
runtime
support
for
J2EE^ application
components ๏^ Application
client container
๏^ Applet
container ๏^ Web^ container ๏^ EJB^ container
๏^ An applet container, meaning a-browser,-usually with the Java Plug-in
๏^ Servlet
container ๏^ Servlet
engine ๏^ A^ J2EE
container
that^ hosts
web^ applications
.
๏^ Extends
the^ web
server^ functionality
by^ providing
developers
the^ environment
to^ run^ servlets
and
JavaServer
Pages^ (JSPs). ๏^ Automatically
instantiates
and^ initializes
the
Servlets
on^ application
startup^
or^ when
invoked
for
the^ first
time.^ Container
calls^ the
service()
method
when^ user
requests
the^ servlet.
๏^ The^ EJB
server
provides
an^ environment
that^ โ Supports
the^ execution
of^ applications
developed
using^
Enterprise
JavaBeansโข
(EJB)^ components. ๏ Enterprise
beans
typically
contain
the
business
logic^ for
a^ J2EE
application.
๏^ The^ EJB
server^ must
provide^
one^ or^ more
EJB
containers. ๏ An^ EJB^ container
manages
the^ enterprise
beans
contained
within^ it. ๏^ Responsible
for โ Registering
the^ object โ Providing
a^ remote
interface
for^ the^ object
โ Creating
and^ destroying
object^ instances โ Checking
security
for^ the^ object โ Managing
the^ active
state^ for
the^ object
โ Coordinating
distributed
transactions.
๏^ Manage
memory
consumption
๏^ Processing ๏^ Containers
pool^ resources ๏^ Lifecycles
of^ all^ the
beans
When^ a
bean^ is
not^ being
used,^ a
container
will^ place
it^ in^ a^ pool
to^ be^ reused
by
another
client,
or^ possibly
evict^ it
from
memory
and^ only
bring^ it
back^ when
its
needed.
A^ container
may^ provide
the^ following
services: ๏ Lifecycle
management ๏^ Bean^
Pooling ๏^ Transactions ๏^ Security ๏^ Connection
pooling ๏^ Instance
pooling
๏^ A^ Web
Server is
a^ server
capable
of
โ Receiving HTTP requests โ Interpreting
them โ Processing the
corresponding
Responses โ Sending them
to^ the
appropriate
clients
(Web^ Browsers). Example:
Apache
Web^ Server.
๏^ It's^ a^
server^
used^ to
communicate
with
Web^ Browsers
as^ its^ clients. ๏^ Communication
protocol used
in^ this
case^ is
(HyperText
Transfer
Protocol). ๏ This^ is
why^ a^
Web^ Server
is^ also
called
an
Server.
๏^ A^ Web^
Container
is^ a^ J2EE^
compliant
implementation
which^ provides
an^ environment
for^ the^ Servlets and
JSPs^ to
run.^ Putting
it^ differently
we^ can^ say
that^ a^ Web
Container
is^ combination
of^ a^ Servlet Engine
and^ a^ JSP
Engine.^ If
an
HTTP^ Request
refers^ to^ a^ Web^ Component
(typically
a
Servlet or
a^ JSP)^ then
the^ request
is^ forwarded
to^ the^ Web
Container
and^ the^ result
of^ the^ request
is^ sent^ back
to^ Web
Server,^ which
uses^ that
result^ to^
prepare^ the
HTTP
Response
for^ the^ particular
HTTP^ Request.
Example:
Tomcat^ is
a^ typical^
Web^ Container.
A^ typical
setup^ would
be^ to^ have
Apache^ HTTP
Server^ as
the^ Web^
Server^ and
Tomcat^ as
the^ Web^
Container.
20
A^ Web^ Server
that^ Support
Servlets^
and^ Java^ Server
Pages
(JSP)