CGI, instant changes. Servlets can be trickier to muck with while the site is live. At development time CGI can be much easier to emulate and verify.

Platform flexibility. CGI is a big win here too. If your boss keeps changing his mind what friggin server software you are going to use, hoo-boy writing servlets is hard. =)

Servlets, deep and fundamental server behavior changes. you can request a servlet decide which format to give the user a graphic in. (aol'ers get gifs, ns+ie<3 get jpg, others get png) You can break the filesystem->url link easily and serve somethings from disk and others from DB, throughout your tree of files, not just up certain branches. Having a tighter link to the server lets you hook things early rather than late why have the server find things on disk you are never going to use, better still let the server find things for you after you tweak where you want it to look.

Servlets, better code reuse, better memory management, better performance under most tasks. In-server caching is much easier.

CGI (deep breath, I can't believe I'm saying this) better security. Messing up a servlet can open gaping holes in your server, massive denial of service holes as well as access holes. You are mucking deep in dark waters and half of what it is doing is a mystery to you.

CGI, no threads, no magic, just run it. =)

---- woof -----

Keep in mind here that I consider mod_perl to be a monster servlet system. And the Java servlets aren't so bad but I HATED EM. =)

HTH

--
$you = new YOU;
honk() if $you->love(perl)


In reply to RE: Servlets vs CGI by extremely
in thread Servlets vs CGI by vroom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.