Computing Reviews

Practical Apache Struts 2 Web 2.0 projects
Roughley I., Apress,Berkeley, CA,2007. 338 pp.Type:Book
Date Reviewed: 04/25/08

Web 2.0 is a term used to describe the current generation of Web applications that are characterized by dynamic interactive interfaces, user-generated content and metadata, and software as services with quick release cycles that necessitate an agile development environment. Struts 2 is the second major release of Apache Struts, a Java-based Web application development framework, with features and improvements geared toward Web 2.0 applications.

The first three chapters briefly introduce Web 2.0 from development and end-user perspectives. They provide instructions on getting started with the Struts 2 framework, in particular the Maven 2 tool for building, testing, packaging, and deploying projects. These chapters also review the core elements that make up the Struts 2 architecture by walking through the processing of a user request.

The features of Struts 2 are introduced through a hands-on approach by developing a complete Web 2.0 application. Chapter 4 gives an overview of this application, a community entertainment service that allows users to vote for contestants on events such as televised talent shows. It presents the development process to be used, as well as supporting technologies. The remaining chapters cover the implementation of the application’s important features: data input, validation, conversion, internationalization, workflows/wizards, security, syndication, Web services, and Ajax user interfaces/integration.

Chapter 5 covers data manipulation, particularly the creation, reading, update, and deletion of user-provided data while using Java’s Hibernate library to provide object-relational mapping for persistence and the Spring framework to provide business services. Wizards and workflows are used to collect information from the user in a series of small manageable screens, without overwhelming the user or collecting unnecessary information. Chapter 6 builds on the previous chapter, and shows the implementation of wizard and workflow functionality.

Struts 2 does not provide any special security features; different options for implementation of the security attributes of authentication and authorization are explored in chapter 7. When the authentication provided by the application server or the servlet container is used, the Web application is isolated from the functionality required to administer users, making this the easiest solution for the developer. Alternatives include reuse of security libraries, such as Acegi, by integrating them with the application, or by custom development of the authentication and authorization infrastructure. Chapter 8 shows how to add a search feature to the Web application and render the subsequent result lists.

Web browsers are not the sole means of accessing information, so it is important for Web 2.0 applications to allow syndication and integration for enabling aggregation and mashup of content by other applications. Chapter 9 covers generation and consumption of really simple syndication (RSS) feeds, providing a representational state transfer (REST) style Web service to the example Web application. Finally, chapter 10 explores options for integrating Struts 2 applications with Ajax user interfaces. One approach is to return Extensible Markup Language (XML) and JavaScript object notation (JSON) responses that can be consumed by JavaScript in the browser. An alternate approach is also presented: creating Struts 2 actions that can be integrated with the Google Web toolkit.

The event voting service implemented by the end of the book shows that when developing a nontrivial Web 2.0 application, Struts 2 needs to be integrated with several other Java technologies, such as Hibernate, the Spring framework, Acegi, and the Google Web toolkit. The book does a good job of introducing these technologies without intimidating the new developer. While Struts 2 lags in comparison to the Ruby on Rails framework for ease of development of Web 2.0 applications, this book is a good introduction for Web application developers interested in a Java-based application framework.

Reviewer:  Suma Adabala Review #: CR135518 (0902-0116)

Reproduction in whole or in part without permission is prohibited.   Copyright 2024 ComputingReviews.com™
Terms of Use
| Privacy Policy