Servlet

From LQWiki
Jump to navigation Jump to search

A servlet is a Java technology that extends the functionality of a web server. One way to think about it is: a servlet is a Java applet that runs server side.

A servlet is the same as a CGI script, except that a CGI script is handled by Apache and run by bash/perl/python, and a servlet is handled by a "servlet container", such as TomcAt and run by a JVM.

Tomcat does double-duty: it can be a web server as well as a servlet container (that is, standalone) -- or it can just be a servlet container that Apache talks to when it needs a servlet run.

Many folks use Tomcat standalone to avoid having to run and configure Apache to forward servlet requests on to Tomcat: they just access their servlets via Tomcat directly:

http://localhost:8080/path/to/your/servlet

External Links