Java Servlets

Servlets are programs that help in building applications that generate dynamic Web pages (HTML, XML). Servlets are a Java-equivalent of the CGI scripts and can be thought of as a server-side counterpart to the client-side Java applets.

Servlets are Java classes that implement a specific interface and produce HTML in response to GET/POST requests.

In an OOM, a servlet is represented as a component, it is linked to a servlet class that implements the required interface and provides the servlet implementation.

When you set the type of the component to Servlet, the appropriate servlet class is automatically created, or attached if it already exists. The servlet class is initialized so that operations are automatically added.