Servlets are Java programs that are activated on a Web server, and run through Java VM. A servlet receives from a browser the data that was entered on one Web page, configures processing results as a new Web page, then outputs the new Web page to the browser.
The Web application development function uses Servlet 2.5 (Java EE 5), Servlet 3.0 (Java EE 6), or Servlet 2.4 (J2EE) as the servlet API executed by the servlet container. The servlet engine is a program that controls the processing between a Web server and a servlet. The servlet container loads a servlet program onto Java VM and calls the servlet API according to the access from the Web browser.
The figure below shows the configuration of a Web application that uses servlets.
Figure 5.3 Configuration of Web Application