It is because you write your own code to handle the HTTP request and send response accordingly, which server makes use of as per the need.

It is because with the help of servlet you can extend the capability of server. Not just Http capability but with your own implementation you can make server to serve different protocol requests too. One fundamental thing we must note here is Servlet is a specification that defines the abilities of a web application on webserver.

servlet are basically the server side programs. whenever we send a request from our browser it is then sent to the web server which finds the corresponding page (html,jpeg etc.). However the web server are meant moreover for the static content i.e. if the content is available in the server then it will sent back.

In the Case of Servlets the web server maps the request to the servlet which has some logic.

web server is not just for static content, it can serve dynamic content using web components like servlet, jsp

Server Extention

They are called Simply Server Extention Because using them U can Extend the server ie u can extend the server functionality.
A web server has limited functionality
as it can’t do atleast two tasks
1) Cannot add somethng to database
2) Cannot generate on-demand/on-the fly/dynamic web pages.
Servets perform these tasks ( and much more also) that is why they are commonly called Server Extentions.

Random Posts