What is Java Servlet?

A servlet is simply a class which responds to a particular type of network request – most commonly an HTTP request. Basically servlets are usually used to implement web applications – but there are also various frameworks which operate on top of servlets (e.g. Struts) to give a higher-level abstraction than the “here’s an HTTP request, write to this HTTP response” level which servlets provide.

Servlets run in a servlet container which handles the networking side (e.g. parsing an HTTP request, connection handling etc). One of the best-known open source servlet containers is Tomcat.

Leave a Comment