Java Servlet Programing Laungage

Java Servlet Projects

Servlet Project 3

adplus-dvertising
Java Servlet :Implementation of GenericServlet
Previous Home Next

javax.servlet.GenericServlet:

This is an abstract class that implements servlet interface and defines all its method except service(). This class is used as a based class of user define servlets.

In web application HTTP protocol is used for communicating with clients and application. This protocol supports following type of requests:

  1. Get
  2. Post
  3. Head
  4. Trace
  5. Connect
  6. put
  7. delete
  8. option

get and post are used to request contents from the server and all other are used for connection setup and management.

Implementation of GenericServlet
public abstract class GenericServlet implements Servlet
{
	private ServletConfig config ; 
	public void init(ServletConfig config)
	{
		this.config=config;
		init();
	}
	public void init()
	{
	/*utility method that can be overrided by application developers
	to perform initialization*/
	}
	public void display()
	{}
	public ServletConfig getServletConfig()
	{
	return config ;
	}
}
Previous Home Next