Java Servlets and JSP

Java Servlets are server-side extensions to any capable server. Most commonly used to extend a Web server, servlets are actually more generic and can theoretically extend any type of server: FTP (file server), SMTP and IMAP (email server), or database server like Oracle. In reality, servlets extend the web server and/or application server.

Bye-bye Applet, Hello Servlet

Where the Java Applet failed, the Java Servlet has succeeded. Java Applets have gone out of favor. The default installation of Netscape 6.0 leaves out the applet JVM, this set the stage for the inevitable. Microsoft announced in July of 2001 that Windows XP will not include a JVM in the operating system's built-in browser, Internet Explorer. Only a few sites today use Java applets: Yahoo Games, SmartMoney.com's excellent stock charting feature, and several others. Developers found it difficult to develop Java programs to run on countless operating systems, several browsers, and many different JVM vendors and versions. After the Sun/Microsoft lawsuit Microsoft was prohibited from incorporating any new versions of Java and was stuck at JDK 1.1. Netscape also used version 1.1 until Netscape 6.0 was released.

Servlets have become the way to create dynamic content on the web using Java. Interestingly enough, Java Servlets are supported by very few web hosting companies. As of the summer of 2001, only 70 out of several thousand hosting companies even offer Servlet support, that's less then 5%. Here is the Adrenaline Group's list of ISP's that provide Java Servlet hosting. Almost 50% offer Microsoft ASP hosting.

For those hosting their own web site, Java Servlets are very popular. Many e-commerce applications use BEA's WebLogic application server that runs Java Servlets and Enterprise JavaBeans. Oracle's application servers, Oracle8iAS and Oracle9iAS, run Servlets, as do all J2EE compliant servers. Refer to Sun's Java Servlet web site to learn more. There you will find an excellent page detailing industry support.

JSP - JavaServer Pages

JSP's are simply uncompiled Java Servlets. This is nice for a developer because all you need is any editor to create a Servlet. You don't need a compiler, the web server does. Simply upload your JSP text file and the first HTTP request triggers a code generator to read your JSP, write a servlet .java file, compile that file with javac, and load it into the Servlet engine and invoke it.

JSP is more than a Microsoft ASP rip-off. JSP's allow for a full-fledged programming language. ASP's only allow scripting languages like JavaScript. Scripting languages are less robust because they are typeless (no enforced data types: integer, float, string, date, etc...). Scripting languages are also not as scalable and maintainable as the code grows. Microsoft is not sitting idle, ASP.NET, like JSP, allows for fully typed languages like Java, VB, C++ and more. What's more ASP.NET does not force you to use one language, JSP's do.

Probably the best feature of JSP are the XML tags which can be extended using your own or third party tag libraries. Refer to Sun's JSP web site to learn more.