2.1 Servlet
The Java Servlet API is one of the most important technologies included in the J2EE platform, providing utility in building dynamic content. It is directly related to another successful technology, Java Server Pages. Regarding the approaches, the java servlet is similar as role and objectives with other technologies like ASP.
A servlet is a java class that can be loaded dynamically an run by a special web server. The object of such class has the role to receives requests (ServletRequest) and generates a response (ServletResponse) based on the request. The API package javax.servlet.http defines the HTTP subclasses of the generic servlet (HttpServlet) request (HttpServletRequest) and response (HttpServletResponse) as well as an (HttpSession) that manages multiple requests and responses between the web server and the client.
For detailing better a servlet, first the web container must be defined: fisrt of all this is also called servlet container or servlet engine. This is the component of a web server that interacts with the servlets. The web container is responsible for managing the lifecycle of servlets, mapping a URL to a specific servlet and ensuring that the URL requester has the correct access rights. The servlet is loaded by the server container the first time is requested and stay in memory unless not sufficient memory space.