NADAR SARASWATHI COLLEGE OF ARTS AND SCIENCE
Name : P.Gayathri
Class : I M.Sc(CS)
Topic : HTTP Servlet,Server
HTTP Servlet
 A servlet is a Java class that runs in a Java-enabled
server. An HTTP servlet is a special type of servlet that
handles an HTTP request and provides an HTTP
response, usually in the form of an HTML page.
 The HttpServlet class extends the GenericServlet class
and implements Serializable interface. It provides http
specific methods such as doGet, doPost, doHead, doTrace
etc.
There are two main servlet types, generic and
HTTP:
 Generic servlets: Extend javax. servlet.
GenericServlet. Are protocol independent.
 HTTP servlets: Extend javax. servlet. HttpServlet.
Have built-in HTTP protocol support and are more
useful in a Sun Java System Web Server
environment.
Use of HTTP servlet request
Interface HttpServletRequest. Extends the ServletRequest interface
to provide request information for HTTP servlets. The servlet
container creates an HttpServletRequest object and passes it as an
argument to the servlet's service methods ( doGet , doPost , etc).
String identifier for Basic authentication.
Constructor of HttpServlet Class :
 HttpServlet()
This is an abstract class so, the constructor does nothing.
Methods of HTTP Servlet:
 doGet, if the servlet supports HTTP GET requests
 doPost, for HTTP POST requests
 doPut, for HTTP PUT requests
 doDelete, for HTTP DELETE requests
 init and destroy, to manage resources that are held for the life of the servlet
 getServletInfo, which the servlet uses to provide information about itself
How Http Servlet works ?
Server:
 Server is a device or a computer program that accepts
and responds to the request made by other program,
known as client. It is used to manage the network
resources and for running the program or software that
provides services.
Server Class:
 ServerSocket Class is used for providing system-
independent implementation of the server-side of a
client/server Socket Connection. The constructor for
ServerSocket throws an exception if it can't listen on the
specified port (for example, the port is already being used). It
is widely used so the applications of java.
Types of servers:
There are two types of servers:
 Web Server.
 Application Server
The block diagram representation of Application Server is shown below:
THANK YOU

gayathri.pptx

  • 1.
    NADAR SARASWATHI COLLEGEOF ARTS AND SCIENCE Name : P.Gayathri Class : I M.Sc(CS) Topic : HTTP Servlet,Server
  • 2.
    HTTP Servlet  Aservlet is a Java class that runs in a Java-enabled server. An HTTP servlet is a special type of servlet that handles an HTTP request and provides an HTTP response, usually in the form of an HTML page.  The HttpServlet class extends the GenericServlet class and implements Serializable interface. It provides http specific methods such as doGet, doPost, doHead, doTrace etc.
  • 3.
    There are twomain servlet types, generic and HTTP:  Generic servlets: Extend javax. servlet. GenericServlet. Are protocol independent.  HTTP servlets: Extend javax. servlet. HttpServlet. Have built-in HTTP protocol support and are more useful in a Sun Java System Web Server environment.
  • 4.
    Use of HTTPservlet request Interface HttpServletRequest. Extends the ServletRequest interface to provide request information for HTTP servlets. The servlet container creates an HttpServletRequest object and passes it as an argument to the servlet's service methods ( doGet , doPost , etc). String identifier for Basic authentication.
  • 5.
    Constructor of HttpServletClass :  HttpServlet() This is an abstract class so, the constructor does nothing.
  • 6.
    Methods of HTTPServlet:  doGet, if the servlet supports HTTP GET requests  doPost, for HTTP POST requests  doPut, for HTTP PUT requests  doDelete, for HTTP DELETE requests  init and destroy, to manage resources that are held for the life of the servlet  getServletInfo, which the servlet uses to provide information about itself
  • 7.
  • 8.
    Server:  Server isa device or a computer program that accepts and responds to the request made by other program, known as client. It is used to manage the network resources and for running the program or software that provides services.
  • 9.
    Server Class:  ServerSocketClass is used for providing system- independent implementation of the server-side of a client/server Socket Connection. The constructor for ServerSocket throws an exception if it can't listen on the specified port (for example, the port is already being used). It is widely used so the applications of java.
  • 11.
    Types of servers: Thereare two types of servers:  Web Server.  Application Server
  • 13.
    The block diagramrepresentation of Application Server is shown below:
  • 14.