This document discusses servlets and their properties. It defines servlets as Java programs that run on a web server and handle requests from the server. Servlets process requests, generate responses, and send them back to the server. The document outlines the basic execution steps of a servlet and the servlet architecture. It describes advantages of servlets like being platform independent and faster than CGI. The document also discusses the servlet container, its functions like loading servlets and managing the lifecycle, and the services it provides such as encoding/decoding messages, resource management, security, and session handling.
SERVLETS
Servlet is asimple java program
that runs an a java enabled web
server or application server.
They are used to handle the
request obtained from the web
serve, process the request,
produce the response, then
response back to the web
server.
3.
PROPERTIES OF SERVLET
Servletswork on the
server side.
Servlet capable of
handling complex
request obtained from
web server.
4.
EXECUTION OF
SERVLET
Execution ofservlets involves the six basic step’s:
1. The client send the request to the web
server.
2. The web server passes the request and
corresponding servlet.
3. The web server receive the request.
4. The servlet processes the request and
generate in the response in the form of output.
5. The servlet send the response back
to the web server.
ADVANTAGE OF AJAVA
SERVLET
Servlet is faster than CGI as it not
involve the creation of a new process
every new request received.
Servlet as written in java are platform
independent.
Remove the overhead of creation a new
process for each request of Servlet
doesn’t run in a separate process.
It is server side components, Servlet
inherits the security provided by the web
server.
7.
SERVLET CONTAINER
Italso know as servlets engine is an
integrated set of object that
provided run time environment for
java servlets components.
In simple words, it is a system that
manages java servlets components
on top of the web server to handle
the web client request
8.
SERVICES PROVIDED BYTHE
SERVLET CONTAINER
Networking Services
Decode and encode MIME based
messages
Manage Servlet container
Resource Management
Security Service
Session Management
9.
NETWORK SERVICES
Load aServlet class. The loading
may be from a local file system,
a remote file system or other
network service.
The Servlet container provides
the network service over which
the request and response are
sent.
10.
DECODE AND ENCODE
MIMEBASED MESSAGES
Provides the service of
decoding and encoding
MIME- based message.
Encoding the container
provides the network
services.
11.
MANAGE SERVLET
CONTAINER
Managelifecycle of a Servlet.
Three methods are central to the
life cycle of a Servlet.
These are init(),service(),and
destroy(). They are implemented by
every Servlet and are invoked at
specific times by the server
12.
RESOURCE
MANAGEMENT
Manages thestatic and dynamic
resource such as HTML files,
Servlet and JSP page.
The init( ), service( ), and destroy( )
methods are the life cycle methods
of the Servlet.
These are invoked by the server.
The get Servlet Con fig( ) method is
called by the Servlet to obtain
initialization parameters.
13.
SECURITY SERVICES
Handle authorizationand
authentication of resource
access.
The Servlet Request interface
includes methods that allow you
to read the names and values of
parameters that are included in
a client request.
14.
SESSION MANAGEMENT
Maintainsa session by appending a session
ID to the URL path.
The Http Servlet class provides
specialized methods that handle the
various types of HTTP requests.
A Servlet developer typically overrides
one of these methods.
These methods are do Delete(), doGet(),
doHead(), doOptions(), doPost(), doPut(),
and doTrace().