CGI programs are usually written in the C or Perl languages. Java Servlet extensions are server-side components. And JSP components are compiled automatically into Servlets, making them the server-side mechanism for JSP technology. Each solution enjoys a loyal following. A portable application environment gives organizations the flexibility to migrate servers and swap tools as business needs change.
Portability also enables developers to share their work with a wider audience.
The CGI interface is supported on a wide variety of Web servers. However, CGI programs themselves are not inherently portable across platforms, so careful design is required to construct portable CGI applications. This is an open source application, providing a higher comfort level than committing to a vendor-specific solution, but still restricting the choice of Web servers. And these programs are not easily portable to different platforms. Once, Run Anywhere TM philosophy of the Java family of technologies.