Java Servlet API
Servlet Technology contains both Java Servlet API and the Java Servlet Specification. Servlet technology is the technology used to develop web components capable of running on web servers/containers. Sun Microsystems developed Servlet technology to overcome the drawbacks of CGI technology( Common Gateway Interface ). Servlet technology is an integral part of J2EE component technology.
Java Servlet technology = Java Servlet API + Java Servlet Specification
The Java Servlet API contains both the classes and interfaces related to the Servlet. Servlet specification provides the rules, guidelines, and regulations to develop Servlets. The vendors will follow the Servlet Specification for providing implementations of the Servlet API.
Servlet API = Java Classes + Interfaces
The J2EE component technologies are as follows:
- JSP(Java Server Pages)
A Servlet is a platform-independent Java class that runs on the server. The server-side java class provides service to the clients across the computer network. Servlets are multithreaded. The Servlet container runs multiple threads to process multiple client requests to the servlet.
Servlet API consists of the following packages.
The javax.servlet package contains the interfaces and the classes that
define the contracts between the servlet class and the runtime provided by the servlet container.
The javax.servlet.http sub-package contains the interfaces and the classes that define the contracts between the servlet class that runs on HTTP protocol and the runtime provided by the servlet container.
The important interface is the Servlet interface. Any servlet class directly or indirectly implements the Servlet interface provided by the Servlet API. The Servlet interface defines the servlet lifecycle methods for creating and destroying them in the servlet container.
Java Tutorial on this website:
For more information on Java, visit the official website :