Java Servlet API
Overview
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
J2EE Technologies
The J2EE component technologies are as follows:
- Servlet
- JSP(Java Server Pages)
Servlet API
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.
- javax.servlet
- javax.servlet.http
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.
https://www.testingdocs.com/java-servlet-lifecycle/
—
Java Tutorials
Java Tutorial on this website:
https://www.testingdocs.com/java-tutorial/
For more information on Java, visit the official website :