this is about full stack backend servlets Today we all are aware of the need to create dynamic web pages i.e. the ones that can change the site contents according to the time or can generate the content according to the request received by the client. If you like coding in Java, then you will be happy to know that using Java there also exists a way to generate dynamic web pages and that way is Java Servlet. But before we move forward with our topic let’s first understand the need for server-side extensions.Servlet is a technology which is used to create a web application. Servlet is an API that provides many interfaces and classes including documentation. Servlet is an interface that must be implemented for creating any Servlet. Servlet is a class that extends the capabilities of the servers and responds
Servlet is a technology which is used to create a web application. Servlet is an API that provides many interfaces and classes including documentation. Servlet is an interface that must be implemented for creating any Servlet. Servlet is a class that extends the capabilities of the servers and respondsn Servlets are the Java programs that run on the Java-enabled web server or application server. They are used to handle the request obtained from the webserver, process the request, produce the response, then send a response back to the webserver. In Java, to create web applications we use Servlets. To create Java Servlets, we need to use Servlet API which contains all the necessary interfaces and classes. Servlet API has 2 packages namely,
javax.servlet
javax.servlet.http
4. Servlet API
Servlet API contains a number of classes and interfaces that describe the contracts between a
servlet class and the runtime environment provided for an instance by a conforming servlet
container.
Servlet API provides the following two packages that contain its classes and interfaces:
javax.servlet.*; Classes and interfaces defines the contracts between a Servlet class and the
runtime environment provided for an instance of such a class by a conforming
Servlet container.
javax.servlet.http.*; Classes and interfaces defines the contracts between a Servlet class running under
the HTTP protocol and the runtime environment provided for an instance of such a
class by a conforming Servlet container.
7. Generic Servlet Abstract Class
GenericServlet implements Servlet interface
It defines Servlet generic and independent of protocols
It doesn’t give implementation for service method of Servlet interface
If your Servlet Generic class, then it should implement service method