1. The Web container is like a TV servlet container like VCD without VCD you can watch TV, right, but with VCD without TV, where do you look? : There is no servlet container, you can also use the Web container to access static pages directly, such as installing an Apache, but if you want to display Jsp/servlet, you will install a servlet container, but the light has a servlet container is not enough, Because it is parsed into HTML output, you still need a Web container.
Most servlet containers provide the functionality of the Web container at the same time, meaning that most servelt can run your Web application independently.
2. In fact, the container is a service program, on the server one port to provide a corresponding service program, and this program is to handle requests from the client, such as the Tomcat container in Java, ASP IIS or PWS are such containers, a server more than one container
3.WEB Container provides an environment for the application component (Jsp,servlet) in which the JSP, SERVLET interacts directly with the service interface in the container, without concern for other system problems. Web container are mainly implemented by Web servers. For example: Tomcat,weblogic,websphere and so on. For example, the servlet container provided by Resin 2.1.x or later implements the Servlet 2.3 specification for the Java EE. Our web server, which adheres to the above criteria, is called the Web container in Java EE. The Web container is more of a deal with HTTP-based requests. And the EJB container is not. It is more about dealing with databases and other services. But they are all interacting with the outside world to reduce the burden on the application. For example, the servlet does not care about the details of HTTP, directly referencing the environment variable session,request,response, EJB does not care about the database connection speed, various transaction control, directly by the container to complete.
Web container and servlet container