Servlet APIs

Servlet APIs


Posted in : Servlet Posted on : October 29, 2010 at 5:15 PM Comments : [ 0 ]

In this tutorial you will learn about complete API of java servlet

Servlet API ( Application Programming Interface)

As you already know API ( Application Programming Interface ) is a collection of classes and interfaces. There are mainly two packages in servlet API

Servlet Hierarche

javax.servlet.

This package provides many classes and interfaces, which defines and describes the difference between a servlet class and a run time environment. This package provides 14 interfaces and 9 classes. They are-

Interfaces

  • Servlet - This interface defines method for all servlets

  • ServletConfig - This interface is used by servlet container to pass the parameter to servlet. This interface is used for individual servlet and unknown to the other servlets

  • ServletContext - This interface contains a set of methods, which is used to communicate with the servlet container and other servlets servlets within an application

  • ServletRequest - This interface provides a client request information to the servlet

  • ServletResponse - This interface provides a servlet response information to the client, it assists the servlet to send the response information to the client.

  • RequestDispatcher - This interface accepts the request from the client sends it to the other application resources.

  • Filter - It performs the filter task on either request or response to the resources

  • FilterChain - This view a chain of filter request for a resource.

  • FilterConfig - It used by the servlet container to pass the information during initialization to the of the filter

  • ServletContextListener - This interface receive a notification when a ServletContext of a web application is initialaised

  • ServletRequestListener - This interface can be implemented if developer wants to notify when any  request out of the scope of web application is coming

  • ServletContextAttributeListener - This interface receive a notification when a change is made in the ServletContext

  • ServletRequestAttributeListener - This interface receive a notification when changes is made in request attribute.

  • SingleThreadModel - This interface is deprecated after the java servlet 2.4.

Classes

  • GenericServlet - This class defines a generic, protocol independent servlet.

  • ServletContextAttributeEvent - This is a event class for, when the attribute of an application changes this class receives a nification.

  • ServletContextEvent - This class receive a notifications when the ServletContext  of an application is changes.

  • ServletInputStream - This provides a servlet input stream for reading binary data from the client.

  • ServletOutputStream - This class provides an output steam for sending binary data to the client.

  • ServletRequestWrapper - This class provides the implementation of ServletRequest interface, the developers can subclass this for their own specific use

  • ServletResponseWrapper - This class provides the implementation of ServletResponse interface, the developers can subclass this for their own specific use

  • ServletRequestAttributeEvent - This is a event class it receive a notification when any change made in the request attribute of the application

  • ServletRequestEvent - This event class indicates the events of the servlet class

javax.servlet.http.

This package provides classes and interfaces which is HTTP protocol specific. There are 8 interfaces and 7 classes in this package

Interfaces

  • HttpServletRequest - This interface extends the ServletRequest interface for provide http specific servlet request

  • HttpServletResponse - This interface extends the ServletResponse interface for provide http specific servlet response

  • HttpSession - It provides a way for identifying a user on the website

  • HttpSessionActivationListener - This interface notify when when session is Activated

  • HttpSessionAttributeListener - This interface can be implemented in order to get notification when attribute of the session is changed

  • HttpSessionBindingListener - This interface can be implemented in order to get notification when object is bound or unbound to the session

  • HttpSessionContext - This interface is deprecated in servlet 2.1 for security resion

  • HttpSessionListener - When developer want to notify the session activation or de-activation, can implement this interface

Classes

  • Cookie - It creates a cookie sent by a servlet to the web  browser, which browser saves and latter return for further communication

  • HttpServlet - This is an abstract class, to create a Http specific servlet you need to extend this class

  • HttpServletRequestWrapper -This class implements the HttpServletRequest interface, the developer can also subclass this for their specific use

  • HttpServletResponseWrapper - This class implements the HttpServletResponse interface, the developer can also subclass this for their specific use

  • HttpSessionBindingEvent - This is an events class, it is activated when session is bound and unbound

  • HttpSessionEvent - This event class generates a notification for changes to the session within a web application

  • HttpUtils - This class is deprecated in servlet 2.3 API

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics