For a HTTP Web server, a servlet is usually used to handle HTTP requests and produce HTML responses on the fly.