Review of Programming Jakarta Struts, 2nd Edition
by Chuck Cavaness, published by O'Reilly
Introduction
Nearly ten years ago, a number of important events were changing
the very landscape of software development. Foremost among these
was the emergence of the World Wide Web (WWW). Another important
event was the introduction of the Java programming language.
While early Java applications focused on client driven
applications like Java Applets, Java slowly gained traction on
the back end as well, becoming a viable component of enterprise
applications. With the introduction of the Servlet technology,
an application could generate dynamic web pages, leveraging all
of the benefits of the Java language. In order to provide the
benefits of Java for dynamic web applications to a wider market,
JavaServer Pages (JSP) were introduced. While powerful, these
technologies did not simplify the development of complex web
applications as different components were intricately connected,
causing maintenance nightmares.
Realizing the problems created by this approach, Craig
McClanahan constructed a framework that separated out the
different components of a Web application into three components:
the Model, which encapsulates the business logic, the View,
which encapsulates what the end-user sees, and the Controller,
which manages the interactions between the view and the model.
Together these three components form the MVC model. Craig
donated his framework to the Apache Software Foundation, and it
eventually became the Struts 1.0 framework. Over the next two
years, other developers began to use the Struts framework, and a
number of improvements were implemented as part of the Struts
1.1 framework.
During this transition period, O'Reilly published the first
edition of Programming Jakarta Struts, by Chuck Cavaness, an
experienced author and Struts developer. Prior to publication,
Chuck had vetted most of the material past the members of
TheServerSide.com. This extra editing resulted in a book that
was not just the result of one person's experience, but
capitalized on the knowledge and experiences of an entire
community. Since the final version of the Struts 1.1 framework
was not released prior to publication, O'Reilly
recently issued a second edition, which is the subject of this
review. Yet the rest of the Java community has not stood still
during this period, and other, competing technologies have
emerged. Anyone contemplating the purchase of this book may
question whether Struts is even relevant with the introduction
of JavaServer Faces, or if the new edition has changed
sufficiently to warrant its purchase.
The Rundown
Programming Jakarta Struts is an impressive text, covering in
amazing detail the full range of the steps required to design
and build Web application using the Struts framework. The second
edition brings the material completely up-to date with the final
version of the Struts 1.1 framework. Overall, this book has
three main positive attributes.
First, the author begins with three chapters devoted to the
introduction of not just the Struts framework, which happens in
Chapter Three, but also the entire concept of a Java based Web
application, in Chapter One and the architectural details of a
Web application in Chapter Two. While those who already are
familiar with the history and basic technology can easily skip
this introduction, it lays the proper foundation for anyone who
is unfamiliar with the basics of Java based Web applications.
Many of these concepts, such as scope or the basics of MVC are
complex, and the author does an excellent job of introducing
them in a straightforward manner.
Second, experienced developers will be pleased with the sample
application that is developed and refined throughout the text.
The Storefront application is not a toy application that has no
bearing on the real world. Instead, it covers all of the aspects
faced by Struts developers from design, through development and
testing, and into packaging and deployment.
Finally, Programming Jakarta Struts describes in incredible
detail all aspects of the Struts framework, some of which are
not covered at all in competing books. This description starts
with Chapter Four, where the reader is guided through the
difficulties of configuring a Struts application. Subsequent
chapters demonstrate how to build the Controller, Model, and
View components. Chapter Seven, where the View component is
introduced also provides a strong coverage of Dynamic Forms,
including the ActionForm and ActionErrors, and a brief
discussion of how JavaServer Faces can integrate into Struts
applications.
The next seven chapters introduce the more complex functionality of
the Struts framework, covering Custom Tags, extension points,
exception handling, the Validator framework,
Internationalization, integrating Struts with EJBs, and Tiles.
The breadth and depth of the coverage of these concepts is
nearly ideal as the reader is shown how to build more powerful
applications in a straightforward manner. For example, in
Chapter Eight, custom tags are introduced, and thoroughly
covered. While some might prefer more emphasis on the JSP
Standard Tag library, the author's approach stands out for two
reasons. First, developers will need to know how Struts specific
tags work in order to properly maintain existing Struts
applications. Second, the JSTL does not contain all possible
tags, such as the HTML tags, a Struts developer might require.
Likewise, the discussion in Chapter 12 on Internationalization
and Struts demonstrates not only how Internationalization works,
but also how to extend an existing Struts application to support
multiple locales.
The last four chapters provide experienced Java developers with
the type of valuable information other sources neglect, covering
advanced topics such as logging, packaging, performance, and
JavaServer Faces. While the material in these chapters might lie
beyond the immediate needs of most developers, eventually anyone
serious about Struts will need to know them, and this book
delivers. Of particular interest is the discussion in Chapter
Seventeen on testing the performance of the sample application
used throughout the book. The final chapter provides a concise
discussion of how Struts and JavaServer Faces can coexist. This
is an obviously important area, and Chapter Eighteen does a nice
job of providing some guidance for any possible transition to a
stronger dependence on JavaServer Faces technology.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.