![]() |
|
Content-driven Web sites that generate their pages dynamically from templates and databases are common nowadays -- so common, in fact, that few remember how arcane and difficult it was to construct such web sites in the first year or two of the Web's explosion. In those bad old days, the contents of forms were typically submitted to "CGI" programs that were custom-written in C or C++, which in turn accessed databases running on UNIX servers through native interfaces, and generated the HTML to be returned to the client browser the hard way -- one printf() statement at a time. Session state was maintained in the databases themselves with IP tracking or URL rewriting. Those poor souls who couldn't maintain a stable of C/C++ programmers to support their web initiatives and didn't live in an academic environment with lots of student programming labor available had few options other than to make do with static web pages, or to rely on primitive and inflexible tag-based solutions similar to early versions of ColdFusion.
Microsoft's introduction of Active Server Pages (ASP) in Windows NT Internet Information Server version 3.0 altered the web server playing field dramatically. In typical Microsoft fashion, minimal if any innovation was involved -- existing bits and pieces of software, much of it originating elsewhere, were glued together under a new name and given away to preempt other technologies and decimate the competition. Microsoft's web server and browser were adapted from code developed by other companies or in the public domain. ASP was little more than repackaging of the existing Visual Basic interpreter combined with some programming syntax from Microsoft Access and the commonly available ODBC drivers and libraries. But the impact was tremendous. Any programmer who could field a copy of Windows NT Server, had a connection to the Internet, and knew a little BASIC and HTML could build a database-driven web site. Within a matter of months, traditional CGI techniques for database access and dynamic page generation became a boutique specialty.
Unfortunately, those of us who built complex web applications with ASP soon learned to our sorrow that Windows NT, IIS, and ASP were not an appropriate vehicle for high-availability, high-performance, 7x24 web services. We all developed ad-hoc strategies to deal with Windows NT's or IIS's propensity to fall over dead unexpectedly, such as load-sharing devices, web server farms, automated monitoring, and regularly scheduled reboots. Many of us wanted to move to other, more robust platforms, but felt trapped by our heavy investment in ASP code, the tight coupling between Microsoft's web server and its operating systems, and the difficulty of converting ASP applications to other languages such as C/C++ or PERL. Luckily, and just in time too, Java Server Pages (JSP) has emerged as a viable alternative to ASP.
Java Server Page applications share many characteristics with ASP applications. JSP scripts can be edited with simple tools, can call pre-compiled components, can mix procedural programming statements with HTML, and can access databases via a simple uniform interface (JDBC). For this reason, porting ASP applications to JSP is quite straightforward. But JSP applications confer tremendous flexibility compared to ASP, because they are platform-neutral, vendor-independent, and scaleable. JSP application servers are available for virtually every server operating system and web server in use today. Furthermore, since JSP scripts can call pre-compiled components (Java servlets) that are likewise platform-neutral and vendor-independent, web programmers no longer need to develop and rely on processor- or operating-system-specific code for performance reasons.
When I first started thinking about moving my clinical applications from ASP to JSP, I looked at a lot of JSP books, but I had trouble finding one that added any value to the JSP information I could get for free on the web. Some of them were too simplistic -- HTML or ASP books that had been superficially rewritten and repackaged as JSP books with little understanding of what the purchaser really needed. Others were little better than shovel-ware -- the authors had taken a large JSP/Java application that they had already written for some other purpose, augmented it with commentary of dubious value and some tables of JSP syntax and functions, and repurposed the entire mess as a JSP programming tutorial.
JavaServer Pages by Hans Bersten is the first JSP book I encountered that hit me at the right level. It allowed me, as an experienced ASP developer, to quickly understand the key points of JSP programming and become productive in the new environment. It was clearly written and carefully edited, it didn't talk down to me, it didn't ramble on for 1200 pages in the hope of excluding its rivals from shelf space at bookstore, and it didn't waste my time with religious posturing or by diversions into technically elegant but obscure areas that had no practical application for me. Although the quality of O'Reilly books has become less predictable in recent years, this is a book in the tradition of the "old" O'Reilly.
JavaServer Pages is divided broadly into three sections. The first section, "JSP Application Basics," provides just enough of an overview to get a JSP server off the ground, including pointers to free JDKs and Java web servers for Windows, Linux, and UNIX. The second section, "JSP Application Development," is pitched at a typical mid-level web application programmer, and will be immediately intelligible to anyone experienced with ASP. The third section, "JSP in J2EE and JSP Component Development," is for the hard-core programmers who previously implemented components in server-side ActiveX or similar technologies for performance reasons.
Industrial-strength Java web servers and JSP programming environments are available from a wide variety of software vendors these days, and run on platforms ranging from the Mac desktop to multi-million-dollar Sun clusters. Why paint yourself into a corner with Microsoft products, take on all the risks and overhead of Microsoft software's endless bugs, hotfixes, service packs, and security holes, and yoke yourself to that endless treadmill of forced Microsoft upgrades and constantly morphing Microsoft APIs? JavaServer Pages can help you get started on the path to independence, and your first experiments with JSP will cost you little more than the price of the book itself.
-- Ray Duncan (ray.duncan@cshs.org)
|
Explanation of ERCB rating scale:
|