KEMBAR78
Servlet api & servlet http package | PPTX
Advanced java programming
Servlet API & Servlet Http package
By
P.Abinaya
 Two packages contain the classes and
interfaces that are required to build
servlets.
 Then are javax.servlet and
javax.servlet.http.
 The Servelt API has been in a process of
ongoing development and enhancement.
 The current servlet specification is version
2.4.
 The javax.servlet.http package
contains a number of classes and
interfaces that describe and define the
contracts between a servlet class
running under the HTTP protocol and
the runtime environment provided for
an instance of such a class by a
conforming servlet container.
 init()
 Service()
 Destroy()
 That methods are the life cycle methods of
servlet.
 The getServletConfig() method is called by
the servlet to obtain initialization
parameter.
HttpServletRequest
Extends the ServletRequest interface
to provide request information for
HTTP servlets.
HttpServletResponse
Extends the ServletResponse interface
to provide HTTP-specific functionality
in sending a response.
The javax.servlet.http package
contains a number of interfaces
and classes that are commonly
used by servlet developers.
That its functionality makes it
easy to build servlets that work
with HTTP requests and
responses.
 The HttpServletRequest Interface
 Extends the ServletRequest interface to
provide request information for HTTP
servlets.
 The HttpServletRequest Interface
Extends the ServletResponse interface to
provide HTTP-specific functionality in
sending a response.
 The Cookie class encapsulates a cookie.
 A cookie is stored on a client and contains
state information.
 Some of the information that is saved for
each cookie includes the following:
o The name of the cookie.
o The value of the cookie.
o The expiration date of the cookie.
o The domain and path of the cookie.
 The HttpServlet class provides specialized
methods that handle the various types of
HTTP requests.
 The methods are
 doDelet()
 DoGet()
 doHead()
 doOptions()
 doPut()
 doTrace().
Servlet api & servlet http package

Servlet api & servlet http package

  • 1.
    Advanced java programming ServletAPI & Servlet Http package By P.Abinaya
  • 3.
     Two packagescontain the classes and interfaces that are required to build servlets.  Then are javax.servlet and javax.servlet.http.  The Servelt API has been in a process of ongoing development and enhancement.  The current servlet specification is version 2.4.
  • 5.
     The javax.servlet.httppackage contains a number of classes and interfaces that describe and define the contracts between a servlet class running under the HTTP protocol and the runtime environment provided for an instance of such a class by a conforming servlet container.
  • 6.
     init()  Service() Destroy()  That methods are the life cycle methods of servlet.  The getServletConfig() method is called by the servlet to obtain initialization parameter.
  • 7.
    HttpServletRequest Extends the ServletRequestinterface to provide request information for HTTP servlets. HttpServletResponse Extends the ServletResponse interface to provide HTTP-specific functionality in sending a response.
  • 8.
    The javax.servlet.http package containsa number of interfaces and classes that are commonly used by servlet developers. That its functionality makes it easy to build servlets that work with HTTP requests and responses.
  • 9.
     The HttpServletRequestInterface  Extends the ServletRequest interface to provide request information for HTTP servlets.  The HttpServletRequest Interface Extends the ServletResponse interface to provide HTTP-specific functionality in sending a response.
  • 10.
     The Cookieclass encapsulates a cookie.  A cookie is stored on a client and contains state information.  Some of the information that is saved for each cookie includes the following: o The name of the cookie. o The value of the cookie. o The expiration date of the cookie. o The domain and path of the cookie.
  • 11.
     The HttpServletclass provides specialized methods that handle the various types of HTTP requests.  The methods are  doDelet()  DoGet()  doHead()  doOptions()  doPut()  doTrace().