Related Topics: ColdFusion on Ulitzer, Java Developer Magazine

CFDJ: Article

JSP and Beyond x2

JSP and Beyond x2

Chris reviews James Goodwill's Pure JSP Java Server Pages and Java Server Pages Application Development by Ben Forta, Edwin Smith, Scott Stirling, Larry Kim, Roger Kerr, David Aden, and Andre Lei.

Pure JSP Java Server Pages
By James Goodwill
Paperback, 320 pp; $34.99 US
Sams 2000
ISBN: 0672319020

Java Server Pages Application Development
By Ben Forta, Edwin Smith, Scott Stirling, Larry Kim, Roger Kerr, David Aden and Andre Lei
Paperback, 500 pp + CD; $49.99 US
Sams 2000
ISBN: 067231939X

While we're often advised not to judge books by their covers, with these two books, I think the names hint at the approach the authors have chosen to take with JSP.

At the start James Goodwill's Pure JSP Java Server Pages reads like documentation but then, ahhh!, straight Java coded examples. Once the setup world of JSP is passed, the book really connects to the technical side of JSP with interesting real-world examples.

Without meaning it negatively, Pure JSP Java Server Pages is a nice mix of book and reference manual. Living up to its promise of being a "code intensive premium reference," the book provides a heady brew of content and code side-by-side with a wealth of reference material. The book takes complex concepts, breaks them down and then lays them out in comphrehensible English.

I found this approach to be both good and bad. The book explains JSP well as the code is right there within the pages of the book, but as the reference material could easily have been included on a CD-ROM — which the book lacks — or linked to a Web site, the original content of the book was less than I had anticipated. The book is perhaps best viewed as a JSP programmer's practical pocket companion.

Goodwill moves in a practical progression by starting with Servlets and then moving onto JSP. The approach will easily be understood from a Java programmer's point of view, or by anyone familiar with CFML or ASP.

The book is broken into two parts: first an introduction followed by discussions of servlets, beans, databases (JDBC and SQL statements), the Tomcat JSP container server, error handling, implicit objects in JSP, and scope. Then, as the book progresses, code snippets and practical examples emerge.

Among the practical examples, a whole chapter is devoted to building a shopping cart. As mentioned earlier in the book, e-commerce is a good use for JSP, so the chapter on shopping carts speaks directly to this and explains in detail everything needed to create a cart in JSP — including detailed information on JDBC connection policy for a Systems Administrator/DBA or overworked programmer.

The book breaks interesting ground with JSP and XML. The basics of XML and Sun's XML parser are covered, along with examples of using XML with JSP. This, in a nutshell, is what Goodwill's book really is: not just words, but examples.

For those who need to implement e-mail into their JSPs, Goodwill dedicates a section to JavaMail classes and exceptions.

The most frustrating thing about a book like this is that you immediately want to go and do it, and you end up by putting the book down to go and tinker around with some JSP code on your computer. But I guess this demonstrates how the book presents JSP as an interesting and worthwhile topic rather than being just another useful programming skill to add to your resume. The book is well-focused and moves through JSP discussions without leaving the reader overwhelmed.

JavaServer Pages Application Development
Get cozy with your laptop and snuggle up with Ben Forta's JSP book, JavaServer Pages Application Development. Written by a group of Java geniuses, the book offers an interesting and informative read for the Java programmer. The book can be read in sequence or, alternatively, by individual chapters that are of especial interest to the reader.

Taking the approach that there's a lot you can do with JSP without learning Java, JavaServer Pages Application Development provides for a wide spectrum of readers and even attempts to teach JSP to readers with little prior Java experience.

While, to the writers' credit, the book dedicates many chapters to HTML concepts for the non-Java web developer, I cringed whenever I heard the power of JSP being reduced to mere HTML when it can be so much more empowering for web applications.

Forta and company speak on a very professional and technical basis in explaining the underpinnings of JSP processing while using an easy to understand and familiar "Hello World" example program. Servers are examined in detail as the book compares Resin, JRun, and Tomcat servlet containers running the same piece of basic servlet code and then observing the differences in how they execute the code.

As the book progresses, it becomes clear that it is intended not only for HTML developers, although it covers much that a HTML developer will find useful. The book's aim moves onto the programmer, who will code as the book is read, and demonstates the usefulness of Java from a CFML programmer's point of view.

For the ColdFusion developer who is considering migrating, the book covers JSP Custom Tags in great detail. The idea of a tag library can be seen as a parallel to the Custom Tag directory in ColdFusion. In this area, Forta's book expands on Goodwill's book by discussing error handling, debugging and troubleshooting.

JavaServer Pages Application Development covers JSP basics such as creating a Web page hit counter, date formatting, methods, and enumeration. It then goes into using the available objects in JSP, which may be unnecessary for the experienced Java programmer and even ColdFusion/CGI programmers will notice a lot of similarities in the implicit objects discussion: application, request, response, and session. While it's good to know they're there if the need ever arises, it's not exactly new.

The book then moves onto some important concepts that the Goodwill book does not consider in depth. Reflection is covered in great detail as a method of introspection. (The book even muses on the origin of the word "introspection"! How's that for detail?)

Forta devotes entire chapters to URL's and connecting pages for the HTML developers, covering the topics of Forms, Frames, Security, Databases, Sessions, and E-mail. This is the "application" part of the book's title, but serves as a basic middle section to an otherwise rigorous discussion of JSP.

As in Goodwill's book, JavaBeans are covered, but Forta's book does so with more detail and deeper explanation.

A value added to the basic structure of the book is an appendix covering popular JSP servers — JRun, Orion, Resin, Servlet Exec 3.0, and Tomcat — for those who will be implementing the servers as well as writing the JSP code.

The book's CD-ROM has evaluations of JSP servers and tools including JRun/Studio, HomeSite and Tomcat. But most important on the CD-ROM are the book's code examples. Even if a CD-ROM contains nothing else, it's always great to get a book's source code listings in electronic form so you can instantly start tweaking and tinkering to see how the code really behaves.

Although developers have traditionally focused on either HTML or Java, JSP crosses into both fields and either of these books will establish a good JSP starting point regardless of the developer's focus. Unfortunately however, in an attempt to reach the widest possible audience and not exclude HTML developers, both books tend to gloss over the real beauty of Java's Object Oriented design.

While Goodwill's Pure JSP Java Server Pages, classified by its publisher as a programming book, is limited to programming JSP and seems intended more for the serious JSP beginner, Forta's JavaServer Pages Application Development, a development book, is aimed at the slightly more experienced HTML programmer, Java programmer, or shop planning to implement a JSP server.

More Stories By Chris Cusack

Chris Cusack is a New Media Engineer at MapInfo Corp. where he is responsible for developing content management and new media applications.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.