Have done both (Java CGI and servlets), but on a smallish scale.
The big advantage, IMHO, is that the servlet model provides an abstraction
of the server functionality that is much more powerful than that provided
by CGI. Servlets know about sessions, responses, requests, headers,
cookies, etc., etc. CGI knows about nothing other than an input stream and
an output stream. Sure, you can develop a bunch of Java classes on your
own that provides similar abstractions, but...you have now reinvented the
wheel (and more than likely, it is oval, not circular). And now you decide
to migrate to an application server (to get things like SQL connection
pooling, transaction processing, security, maybe EJB's). Guess what: your
homegrown classes aren't portable, but if you had written to the servlet
API, your application would be. And now you want to separate presentation
from business logic, so you want to rip all the HTML code out of your app
and stick it into JSP pages, and use beans to mediate between your server
app and your pages...guess what...your homegrown classes didn't anticipate
that, and you are stuck.
>From someone who has seen both sides, Java CGI bad, servlets good.
----------
> From: Vijayendra M Agrawal <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Servlet Vs CGI (both in Java)
> Date: Wednesday, August 18, 1999 12:33 AM
>
> Hi,
>
> My project is using CGI in Java. I want to know the
> advantages/disadvantages, if I try to use Servlets instead of CGI.
>
> I have worked with Servlets, and I know the basic functionality of
Servlet.
> I want to prove that Servlets are much better than CGI. If my project had
> been using some other language instead of Java, I could have gathered
many
> advantages, which Java as a language provides, but here, the whole thing
> lies in the comparison between Servlets and CGI.
>
> Any help will be appeciated.
>
> Thanks in advance.
>
> Vijay
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html