GenericServlet class

public abstract class GenericServlet extends Object implements Servlet , ServletConfig, Serializable
Method of GenericServlet Class
  1. public void init() throws ServletException; This method provides no need to override super.init(config).
  2. public void init(ServletConfig config) throws ServletException;   This method is used to initilize the servlet.
  3. public abstract void service ( ServletRequest request, ServletResponse response) throws ServletException, IOException; This method is used to sending request and servelet build a response.
  4. public void destroy(); This method remove a servlet instance out of service.
  5. public String getInitParameter ( String name); This method returns the parameter value of given the paramter name.
  6. public Enumeration getInitParameterNames (); This method returns the all parameter name.
  7. public ServletConfig getServletConfig (); This method returns the ServletConfig object.
  8. public ServletContext getServletContext (); This method returns the ServletContex object.
  9. public String getServletInfo (); This method returns the Servlet information (for example author, creation date, description and so on).
  10. public void log(String message); This method writes the name of servlet and message argument to the web container's log.
  11. public void log(String message, Throwable t); This method writes the name of servlet and message argument to the web container's log and include the stack trace for the given Throwable exception.
  12. public String getServletName(); This method returns the name of Servlet.
 



 

Latest Tutorial


Most Visited Tutorial