The non-Java term for a web server helper app is “CGI” program
Most CGI programs are written as Perl scripts, but many other languages can work including C, Python, and PHP. (CGI stands for Common Gateway Interface, and we don’t care why it’s called that.)
Using CGI, here’s how it might work for a dynamic web page that has the current server date.

Servlets and CGI both play the role of a helper app in the web server
Listen in as our two black belts discuss the pros and cons of CGI and Servlets.

CGI is better than Servlets. We write CGI scripts in Perl at our shop, because everybody knows Perl. | |
I doubt everybody knows Perl. I like Perl, but we’re all Java programmers in our shop so we prefer Java. | |
I guess that’s fine if you use Java, since you know it. But it’s certainly not worth it for us to switch to Java. There’s no advantage. | |
With much respect, master, there are many advantages to using Java over Perl for the things you want to do with CGI. | |
You challenge me? On what grounds? | |
Performance, for one thing. With Perl, the server has to launch a heavy-weight process for each and every request for that resource! | |
This is no different from Java... what do you callthe JVM? Is not every instance of the JVM a heavy-weight process? | |
Ah, yes, but you see Servlets stay loaded and client requests for ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access