Scripted Servlets
A Java servlet is without doubt the most elegant and powerful mechanism for delivering dynamic Web content. Anything that can be done, can be done using a servlet. In the hands of a competent Java programmer, that is. But the Web is driven by HTML scripters, not Java programmers; the latter are an expensive resource. Too expensive to waste on generating run of the mill dynamic pages.
So the commercial world stays with ASP and Microsoft gets all the business. But does it have to be that way? Imagine you could write servlets using something close to plain English (a syntax similar to SQL queries, in fact), then compile them to efficient Java classes. Servlet technology would then be open to anyone.
Such a technology exists, and it's free. Here we keep all the power of the servlet but offer a way for people who aren't Java programmers to deliver dynamic content. This toolkit is a scripting language, a compiled system written in Java but targetted at Web designers rather than professional programmers. It contains a rich set of functionality in a very easy to understand syntax, and sacrifices practically no performance compared to all-out Java. And if you find the need for a function that hasn't been implemented, the Java source is right there, under the terms of the GNU General Public License. The scripting toolkit is called Linguist and has many uses beyond servlets (such as multimedia), but servlets are what we're here for now.
This article shows how easy it is to write a scripted servlet, by creating a real-life project to manage records for a video rental shop. You will see how to construct an on-line relational database for the customers, the videotapes and the loans, all managed from a browser.
Who should read this article
This article is aimed at webmasters and website designers/builders. To get the best from it you need to be familiar in outline with what a servlet is, how to set up aliases in a Web server and the nature and form of HTTP requests. There's no Java code in here, so some programmers may be disappointed. They can get their fix by diving into the source of the package.
Setting up a servlet is not difficult, but there are lots of steps and places for things to go wrong. So read the instructions carefully and it should all work out without too much pain.