Codecademy Logo

Servlets

Servlet Containers

In Java, the servlet container manages servlets and communicates with the server on behalf of the servlet.

Servlets

In Java, a servlet is a class that responds to server requests.

Deploying Servlets

Java servlet applications are deployed using Tomcat.

Servlets and CGI

In Java, servlets overcame all the deficiencies that came with creating Common Gateway Interface (CGI) applications.

Creating Servlets

Servlets in Java are created by extending the GenericServlet or HttpServlet classes.

web.xml

When working with Java servlets, the web.xml file is used to register them and map URL paths to them.

Servlet Request and Response

In Java, HttpServlet classes use the HttpServletRequest object to receive parameters from the client and HttpServletResponse object to provide a response back.

HTTPServlet Overriding

In Java, HttpServlet applications are implemented by overriding the doGet(), doPost(), doPut(), or doDelete().

Learn more on Codecademy