Servlet API

What is Servlet API?
Servlet API has two packages:
  1. javax.servlet
  2. javax.servlet.http
javax.servlet: The javax.servlet package contains a number of classes and interfaces . The classes in javax.servlet package are protocol independent.
javax.servlet.http: The javax.servlet.http package contains a number of classes and interfaces. Some of the classess and interfaces in the javax.servlet.http extends those specified in the javax.servlet package.This interface specifies the contact between the web container and a servlet.
When we write a servlet, we must implement this interface directly or indirectly.
Interfaces in javax.servlet package
There are following interfaces in javax.servlet package.
  1. Servlet
  2. ServletRequest
  3. ServletResponse
  4. RequestDispatcher
  5. ServletConfig
  6. ServletContext
  7. SingleThreadModel
  8. Filter
  9. FilterConfig
  10. FilterChain
  11. ServletRequestListener
  12. ServletRequestAttributeListener
  13. ServletContextListener
  14. ServletContextAttributeListener
Classes in javax.servlet package
There are following classes in javax.servlet package.
  1. GenericServlet
  2. ServletInputStream
  3. ServletOutputStream
  4. ServletRequestWrapper
  5. ServletResponseWrapper
  6. ServletRequestEvent
  7. ServletContextEvent
  8. ServletRequestAttributeEvent
  9. ServletContextAttributeEvent
Exception classess in javax.servlet package
There are following exception classes in javax.servlet package.
  1. ServletException
  2. UnavailableException
Interfaces in javax.servlet.http package
There are following interfaces in javax.servlet.http package.
  1. HttpServletRequest
  2. HttpServletResponse
  3. HttpSession
  4. HttpSessionListener
  5. HttpSessionAttributeListener
  6. HttpSessionBindingListener
  7. HttpSessionActivationListener
  8. HttpSessionContext ( Deprecated. As of Java(tm) Servlet API 2.1 for security reasons, with no replacement. )
Classes in javax.servlet.http package
There are following classes in javax.servlet.http package.
  1. HttpServlet
  2. Cookie
  3. HttpServletRequestWrapper
  4. HttpServletResponseWrapper
  5. HttpSessionEvent
  6. HttpSessionBindingEvent
  7. HttpUtils ( Deprecated. As of Java(tm) Servlet API 2.3. )
 



 

Latest Tutorial


Most Visited Tutorial