In order to execute a JSP file(Page), the web server must be loaded with a software capable to execute JSPs. The software loaded provides an environment for execution of a JSP. This environment is known as JSP engine or JSP container. Similarly, a Servlet container provides environment for a Servlet to execute.
A Web container is a general term which executes Web programs like ASP, Servlets, JSP, PHP etc. So, a JSP container and a Servlet container are Web containers.
In general a container has the following responsibilities:
==============================================================
* Should provide standard libraries required for coding.
* Should provide suitable environment for execution.
* Should call callback methods at appropriate times for the smooth execution.
* Should maintain the life cycle of the program
In particular, a JSP container responsibilities:
------------------------------------------------------------------------------------------
The JSP container should be capable to translate JSP file to a Servlet file, compile the servlet file, execute the Servlet and send the output of execution to client as response. As internally, a JSP file is converted to Servlet, the JSP container should also come with a Servlet container.
In particular, a Servlet container responsibilities:
--------------------------------------------------------------------------------------------
* Should capable to load the Servlet .class file at the request of the client, execute the Servlet.
* Access the database server, if required.
* Send the output of execution to client as response.
* When the response is delivered close the connection with the client.
5