CGI How To

The CGI (Common Gateway Interface) defines a way for a web server to
interact with external content-generating programs, which are often
referred to as CGI programs or CGI scripts.

Within Tomcat, CGI support can be added when you are using Tomcat as your
HTTP server and require CGI support. Typically this is done
during development when you don't want to run a web server like
Apache httpd.
Tomcat's CGI support is largely compatible with Apache httpd's,
but there are some limitations (e.g., only one cgi-bin directory).

CGI support is implemented using the servlet class
org.apache.catalina.servlets.CGIServlet. Traditionally,
this servlet is mapped to the URL pattern "/cgi-bin/*".