Common tasks performed in servlet container in Java

  • Data exchange support. The servlet container provides an easy way to exchange data between a web client (browser) and a servlet. Thanks to the container, there is no need to create a socket listener on the server to track requests from the client, as well as parse the request and generate a response. All these important and complex tasks are solved using the container and the developer can focus on the business logic of the application.
  • Servlet and resource lifecycle management. From loading the servlet into memory, initializing, injecting methods, and ending with destroying the servlet. The container also provides additional utilities such as JNDI to manage the resource pool.
  • Multithreading support. The container itself creates a new thread for each request and provides it with the request and response for processing. This way, the servlet is not re-initialized for every request, thereby saving memory and reducing the time before the request is processed.
  • JSP support. JSP classes are not like standard Java classes, but a servlet container transforms each JSP into a servlet and is then managed by the container like a regular servlet.
  • Various tasks. The servlet container manages the resource pool, application memory, garbage collector. Provides security customization options and more.

Read also:


Comments

Popular posts from this blog

Methods for reading XML in Java

XML, well-formed XML and valid XML

ArrayList and LinkedList in Java, memory usage and speed