Technology used to create web application (resides at server side and generates dynamic web page).
Servlets are used to read data from web browser through servlets classes.
To run servlet classes, it required servlets containers.
Container will read data from the user through servlet classes.
It is robust and scalable because of java language.
"Before Servlet, CGI (Common Gateway Interface) scripting language was popular as a server-side programming language."
What is a Servlet?
It can be defined in many ways, depending on the context.
Servlet is a technology i.e. used to create web application.
Servlet is an API that provides many interfaces and classes including documentations.
Servlet is a web component that is deployed on the server to create dynamic web page.
Servlet is an interface that must be implemented for creating any servlet.
Advantages of Servlets
Better performance, because it creates each thread for each request but not process.
Portability, because it uses java language.
Robust, these are managed by JVM so we don't need worry about memory leakage or garbage collection.
"We heard the term about CGI (Common Gateway Interface), Lets discuss a brief about it"
CGI technology enables the web server to call an external program and pass HTTP request information to the external program to process the request. For each request, it starts a new process.