Buy Used
+ £2.80 UK delivery
Used: Good | Details
Condition: Used: Good
Comment: Get this book fast, expedited shipping available.
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Programming Jakarta Struts Paperback – 23 Nov 2002

12 customer reviews

See all 2 formats and editions Hide other formats and editions
Amazon Price New from Used from
Paperback, 23 Nov 2002
£18.86 £0.01

There is a newer edition of this item:

Product details

  • Paperback: 464 pages
  • Publisher: O'Reilly Media; 1 edition (23 Nov. 2002)
  • Language: English
  • ISBN-10: 0596003285
  • ISBN-13: 978-0596003289
  • Product Dimensions: 17.8 x 3 x 23.3 cm
  • Average Customer Review: 3.8 out of 5 stars  See all reviews (12 customer reviews)
  • Amazon Bestsellers Rank: 2,961,787 in Books (See Top 100 in Books)
  • See Complete Table of Contents

More About the Author

Discover books, learn about writers, and more.

Product Description

About the Author

Chuck Cavaness is a graduate from Georgia Tech with degrees in computer engineering and computer science, has built Java-based enterprise systems in the healthcare, banking, and B2B sectors. Working at an Internet company to design and develop software architecture, Chuck has spent many frustrating hours figuring out the dos and the don'ts of web applications. With each enterprise system he's developed, Chuck has learned several valuable lessons about building "real-world" web applications, information that he's made available to developers who haven't had the opportunity to work on large systems. Chuck is the co-author of Special Edition Using Java 1.3 and Special Edition Using EJB 2.0, both available from QUE.

Excerpt. © Reprinted by permission. All rights reserved.

Chapter 14 -Using Tiles
Up to this point, not much has been said about how to organize and assemble the content and layout of JSP pages for a Struts application. In many ways, that is outside the scope of the topic of Struts. Many excellent books are available that provide strategies for organizing web content and the layout of pages.
In the Storefront application, we have used two different approaches to assembling web pages. The first approach, sometimes referred to as a straight JSP-based approach, is probably the most familiar to web designers. The JSP pages contain presentation logic along with HTML layout tags; there's no separation of the two. This approach is typically used for smaller, less complicated web applications.
The second approach uses the JSP include directive. It's used by developers for larger web applications, or after they realize how repetitive the first approach can be. If you have spent much time maintaining web applications, you know how frustrating it can be to update a site's look and feel. Using the JSP include directive allows for more reuse, which reduces the total development and maintenance costs.
A third approach, which is introduced in this chapter, describes a far better way to reduce the amount of redundant code a web application contains and, at the same time, allows you to separate the content from the layout better than the first two approaches.
Understanding Templates
Traditional GUI toolkits such as VisualWorks Smalltalk or Java Swing all provide some type of layout manager that dictates how content should be displayed within the frame or window. With typical web sites, the layout can undergo many changes, both small and large, over its lifetime. Using layouts and layout managers can help to encapsulate the physical areas of the pages within an application so that they can be altered with minimal impact to the rest of the application. Unfortunately, the JSP technology does not natively provide any direct support for layouts or layout managers. This is why the template-based approach was invented. The concept of templates is not a new one--it has been around for many years, in one form or another.
To understand how templates can actually simplify a web site's layout, let's compare it with an approach that uses the JSP include mechanism. The current index.jsp page of the Storefront application is shown in Example 14-1.
Example 14-1: The index.jsp page for the Storefront application
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<title><bean:message key="global.title"/></title>
<script language=javascript src="include/scripts.js"></script>
<link rel="stylesheet" href="stylesheets/format_win_nav_main.css" type="text/css">

Although the main page uses the JSP include directive, the layout is mixed with content in the page. For example, notice that the page specifies explicitly that the include file comes first, then the file, the file, and so on, right down to the include at the bottom of the page. For every page that we want to have this particular layout, we need to add the same statements in the same order. If a customer wants the menu along the left side instead of across the top, every page will have to be changed.
The Storefront application uses the JSP include mechanism rather than a straight JSP approach. Although the include mechanism is a step in the right direction because it does reduce redundancy (imagine if we included the copyright content in every page!), it's still less efficient than a template-based approach.

Customer Reviews

3.8 out of 5 stars
Share your thoughts with other customers

Most Helpful Customer Reviews

6 of 6 people found the following review helpful By Thomas Paul on 21 Feb. 2003
Format: Paperback
The target for the book is any experienced Java developer who is interested in Struts but has little or no experience with Struts. The book starts with an explanation of why Struts is a "good thing" and shows how Struts fits into a web architecture. The author then gives an explanation of each of the pieces of the Struts architecture and demonstrates a simple application. Although the explanations were clear, I felt that the author was making the architecture overly complicated by explaining things out of order. A diagram showing the interrelationships of the different Struts classes and config files would have been helpful. The author covers all the expected topics such as internationalization, exception handling, logging, and the Struts tag libraries. The chapter on the Struts tag libraries could have used more examples to make the explanations clearer. The book concentrates on Struts 1.1 and the author does a nice job of explaining the changes from the 1.0 version and the features available in the new version. The chapter on the new Validator framework is clear and the examples, though limited, are on target. However, since there is so little documentation currently available on using the built-in validators it would have better for the author to have included explanations and examples for each one. The chapter on Tiles is short but the author does a great job of explaining how it fits into the Struts architecture. The chapter on performance seemed completely unnecessary since there was nothing in it specific to Struts. Overall this book is a good addition to the Struts library. The book has some shortcomings but it provides a good deal of value.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
5 of 5 people found the following review helpful By M. Hodgins on 16 July 2004
Format: Paperback
In a word, impenetrable. By chapter 5, I still didn't have the working knowledge to send a request to a Struts servlet! The author seems to be more interested in letting us know how great his understanding is of the internals of Struts that he can find little time to let us learn how to actually employ the framework.
Furthermore, the writing style is too dry and reliant on tables of data and xml schemas, and not enough on working examples and discussion. Learning by doing, this isn't.
There are better books by more accomplished authors.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
13 of 14 people found the following review helpful By lfreyberg on 28 Jan. 2003
Format: Paperback
While this book is well written and very readable it is miss-titled. If it had been titled 'Building Java Web Applications using Struts and other tools' I would have given it a higher rating, as this is what much of it is about.
Expecting a book on how to use Struts, I was disappointed when I discovered that a lot of the book simply discusses building Java based web applications - Discussions that have little to do with Struts. In addition several of the 'Struts' chapters are inadequate, and some information is missing completely, such as how to integrate struts with declarative security and JAAS.
Blow by Blow:
Chapters 1,2 - Web and Web App. overview. Unless you are completely new to web development and Java based web applications these chapters are a waste of space and time. At best a refresher.
Chapter 3 - A high level overview of Struts. Useful if you have never used it before.
Chapter 4 - An in-depth discussion of struts configuration. Useful as a reference as the struts documentation is lacking in this regard.
Chapters 5,6,7,8 - Detailed look at framework internals. Some useful bits in here, but most of the information is not needed to actually use the framework. Still, interesting if you like to know what happens 'under the hood'.
Chapter 9 - Good chapter on the pros and cons of extending the framework, including common extension points.
Chapter 10 - All you need to know about exception handling with Struts.
Chapter 11 - Good chapter on the validation framework, including internationalised validation and re-using the validation framework outside.
Chapter 12 - Internationalisation, but does not discuss internationalisation of images and other resources.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
2 of 2 people found the following review helpful By Bradley Mead on 29 Dec. 2003
Format: Paperback
This book definitely contains enough information for an experienced Java developer to start using Struts quickly. I like the book but do have some gripes about it.
The author mentions wizard-style html forms on several occassions in the book, emphasising their usefulness and popularity amongst web developers. Rather than providing the reader with a decent worked example, he leaves us with a few clues and the comment that "This can be a little tricky". I had to download and read the Struts source to really understand how multi-page forms should be configured and used.
I was especially disappointed with the chapter on exception handling. I was rather hoping for an example illustrating how an error can be trapped in an Action class and subsequently used by a jsp page. It just wasn't there. Instead the reader is given an overview of how the JVM searches up the call stack until it finds an appropriate catch block for an exception - something I am sure the target audience doesn't need to be told. The benefits of exception chaining and not exposing low-level exceptions in a client interface should already be familiar to most developers.
I was really looking for a book with more comprehensive examples throughout. Although it contains a lot of code snippets and sufficient explanation of each class in the framework, it fails to expand on the more advanced topics. Overall I felt the book didn't provide a unified description of the subject and I was left having to work out the missing pieces for myself.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Recent Customer Reviews