CGI needs to have some kind of process on the server side. In early days this might be a web server that recognized the CGI url and ran a Perl script. Some ISP allow you to run CGI Perl scripts.
Naturally us Java types run a Java servlet capable web server.
Incidently, servlets and
JSP use exactly the same interface as "CGI" so I really don't think there should be a distinction.
Bill