Note - Servelets and JSPs

Request - response model

Cleint is basically something or some one who is requesting for some resource.

Server is basically a machine which serves the request.

                        Client request for a static page and server serves a static page,cause webserver can serve only static HTML pages.

Then to handle Dynamic requests?

Here, Servelets come to the picture.

                    Helper application for dynamic requests is nothing but a "Servelet".

What is a web container?

                     Client sends a GET request to the server and server sends a request to the servelet to build the dynamic page. Servlet is a special java programme which has no main method but call back methods.

                In the middle of the server and servlet there is  the web container as the bridge. Web container is a servlet engine and it helps web server to communicate with the servlet. And also it is responsible for the invoking methods on the servlet and servlets live and die with in a web container.

How does the container handle a request?

              It communicate with the servlet and allow the servlet to build the dynamic content and send back the response to the server which will ultimately go to the client.

              The request client sends and the request web container sends are totally different. Because web server understands only HTTP requests and servlet is a java programme. And it understanda java objects. So web container convert HTTP request into a valide request object.

What is the roll of a web container?

Communication support
Life cycle management
Multi-threading support
Security
JSP support

Master file for the web container is web.xml file.

And a servlet has 3 names.
They are
Client known URL name
Deployer known servlet internal name
Actual file name

It helps to the simplicity and security of the servlet.

Comments

Popular posts from this blog

How to push a file into a docker container

Docker - Begginer 1

Project(on going) - IPv6 Fragmentation