Web Informant #109, 21 April 1998:
Making hard things easy: Java Servlets

http://www.strom.com/awards/109.html

"Larry Wall, Perl's creator, likes to say that Perl aims to makes easy things easy and hard things possible. Java [servlets], on the other hand, tends to make hard things easy, but easy things hard." --
Jon Udell, writing last July in Byte magazine

When most of us think about Java, we tend to think what can run on our desktop machines. Our next thought is usually one of frustration, because the browser on our desktop doesn't work with with whatever Java-based application we are trying to run. Indeed, some of us have more than one browser on our desktops to deal with this issue, and that quickly gets to be a mess. Netscape and Microsoft both have a nasty habit of delivering new browser versions but reusing the same version number, making it difficult for any normal human to keep track of what browser supports what piece of Java (JRE, JDK, whatever: call it J**). Is there a version numbering shortage? Can't Netscape, for example, just call the next release after 4.04 something like 4.05 for clarity's sake?

Like many of you, I tire of this exercise. But the real story of Java's success is what you can build inside web servers, something that is never seen by any client and happens mostly under the covers. And the good news is that you don't need the latest and greatest browser, because by the time the server-side Java is finished, all you are going to see is straight old plain-Jane HTML. No muss, no fuss, and it runs on lots of older browsers too.

I first came across the server side situation last summer, when I wrote a review for in Infoworld on Javasoft's Java Web Server. This is a fairly feature-rich web server written entirely in Java. That may be an interesting programming exercise, but what got me interested was the invention of what Javasoft calls servlets, applications that can extend the functionality of the web server in new and interesting ways, just as Java applets extend the browser experience on the client side.

Servlets haven't gotten much attention by the computer press but I think will have a much greater impact ultimately on our community. They make a great deal of sense for web developers, for several reasons:

First, they are a powerful scripting mechanism that are fairly well documented and easily learned. Indeed, Lotus Merchant makes use of servlets in their latest release to add functionality to their eCommerce server, which began as a Notes server! While Perl and CGI remain popular, servlets can retain and reuse code objects in the server's memory, making them more efficient than handling multiple CGI requests.

Second, servlets are already supported in many different web servers. Besides Javasoft's server, there are several other web servers available. (Udell's article above has links to Jigsaw and Acme, two web servers that are built entirely in Java and can run servlets. And Apache and IBM have both efforts underway with servlets as well.) I trust Jon and some others who tell me that it isn't a big deal to take a servlet developed on one platform and move it to another one. So while Sun and others wrestle with the cross-platform portability of client-side Java, this is already happening on the server side.

But cross-platform portability isn't the entire story. Servlets can customize the web experience in new and interesting ways, making them the tool of choice for saavy web developers that want to deliver interactive content, or query databases, or deliver non- textual pages. A new firm called in PlusFactor is using servlets on top of Microsoft's Personal Web Server to provide group calendars via the web: when they tried to develop their application using more traditional (if such a word could be used) client-side Java applets, they found it was too much trouble to deal with the various browser and platform versions.

Finally, putting servlets together makes a great deal of sense from the conservation of network bandwidth: you don't have to send megabytes of code down the wire to your client, when you can run your applications wholly inside your server and just send the results to the browser. Again, I point you back to Udell's Byte article, where he explains the details about how he built a few servlets.

My prediction is that client-side Java will eventually be subsumed by the Windows API: it is just a matter of time, whatever the DOJ ends up doing. And then Javasoft can concentrate on the server, where real web-based applications belong. Perhaps then they can make the easy things easier, too.

Self-promotions dep't

One of the benefits of writing these essays is seeing them spread throughout the Internet in new and interesting places. My columns have been run in the Chicago Tribune, the Daily Yomiuri (a Tokyo newspaper), and the latest place in TidBITS, Adam Engst's venerable newspaper for all things Macintosh.

Are you going to Vegas Interop? I'll be there, teaching and speaking in several capacities. Monday and Tuesday will be taken up with a two-day course on eCommerce that I am teaching with Stephanie Denny and have taught at various other Interops around the world. Wednesday evening will find me presenting the session "Microsoft Wins Everything" and Thursday afternoon I'll be sharing the stage with Dave Piscitello and Lisa Phifer demonstrating embedded web servers and why they are important. I hope to see you at one of these events.

And before I make it to Vegas, I'll be going to Caracas to teach an all-day seminar next week on web, eCommerce, and push technologies. If you are in the area, let me know and I'll send you details.

David Strom
david@strom.com
+1 (516) 944-3407
back issues
entire contents copyright 1998 by David Strom, Inc.
Web Informant is ® registered trademark with the U.S. Patent and Trademark Office