Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Servlet container


May 15, 2021 Servlet



Servlet containers are primarily Java Web applications that provide runtime environments, so they can also be called Java Web application containers, or Servlet/JSP containers. Servlet containers are primarily responsible for managing the lifecycle of servlets, JSPs, and their shared data.


What are the servlet containers:

Currently the most popular servlet container software includes: Tomcat, Jetty, Jboss, etc.


Tomcat

Like Web servers such as IIS, Tomcat has the ability to handle HTML pages, and it is also a servlet and JSP container, with a separate servlet container as Tomcat's default mode. However, Tomcat is not as good at handling static HTML as apache servers.


Jetty

Jetty is an open source servlet container that provides a running environment for Java-based web containers such as JSP and servlet. J etty is written in the Java language and its API is published as a set of JAR packages. Developers can instantiate Jetty containers into an object that quickly provides network and web connectivity for some stand-alone Java applications.


Jboss

Jboss is an open source application server based on J2EE. T he JBoss code is LGPL licensed and can be used free of charge in any commercial application. J Boss is a container and server that manages EJB, supporting the specifications of EJB 1.1, EJB 2.0, and EJB3. However, JBoss Core Services does not include web containers that support servlets/JSPs and are generally used in to bind to Tomcat or Jetty.


Servlet is a platform-independent server-side component (java written, cross-platform) that runs in a servlet container.

The servlet container is responsible for the communication between the servlet and the customer, as well as the method by which the servlet is called, and the communication between the servlet and the customer is in the "request/response" mode Servlet does the following:

1, create and return a dynamic HTML page based on customer requests

2. Create some HTML pages (HTML fragments) that can be embedded in existing HTML pages

3. Communicate with other server resources, such as databases or Java-based applications


The servlet container responds to the customer request process:

Servlet container