Wilson Fereira writes "The Jakarta Struts framework is undoubtedly the most popular MVC framework for developing web applications in J2EE. A lot of books have emerged to satisfy the appetite of avid Struts reader including the two famous books from O'Reilly and Manning Publications. Struts Survival Guide: Basics to Best Practices (SSG) is a new addition to the already growing list of Struts books. SSG is from a new comer in the publishing business - ObjectSource Publications." Read on for the rest of Fereira's review.
Even before I started reading the book, the fact that stood out most was its pricing. The book costs $14.95, and is great buy for everybody and especially students. The book is light -- just 224 pages -- and is an easy read. The authors' style is neither dry nor humorous, but very convincing and developer friendly. Bottom line: It does not put you to sleep.
There are two aspects to any framework: the first aspect is the features of the framework itself; the second aspect is how easy it is to use them effectively. This book does justice to both aspects of Struts. It covers enough framework features to justify its title, starting from bare bones and then slowly guiding you to more advanced topics. In addition, there are chapters dedicated to dealing with variety of scenarios in web applications where Struts can be used to solve the problems effectively. This is the area where the book shines.
Chapter-wise reviewsThe book starts off with an excellent introduction to MVC and how Struts fits into MVC. It then explains the basics of Struts very well and develops a hands-on application in Struts in the first three chapters.
The fun starts from Chapter 4 onwards. Chapter 4 covers advanced Struts concepts and presents some interesting ideas about Struts Action design. Of particular interest are the coverage of how to protect your JSPs from direct access, using SwitchAction to navigate between multiple Struts modules. The different mechanisms of Action chaining and scenarios where Action chaining is not recommended is also an enlightening read. One of the controversial points in the book is that author discourages you from using XDoclet and explains why XDoclet is not a great idea with Struts.
Chapter 5 covers the validation in Struts. It is the shortest write up on Validation I have ever read and yet it beautifully explains the Commons Validator and its integration with Struts. In the context of validation, the author also explains when to use DynaActionForm and its derivatives and when not to.
The Chapter 6 provides little details on the Struts Bean tag library except for dealing with multiple resource bundles and some design tips. Perhaps the reason is that the bean tags are so straight forward and covered well in the Struts web site. Another highlight of the chapter is a short yet great coverage of JSTL as a background for Struts-EL. The JSTL is introduced in the context of Struts Logic tags as a solution to deal with convoluted and and confusing nested tags. The section on Struts-EL is really short and could have been more.
The creme la creme of Chapter 6 is the section on dealing with List Forms. Sometimes you often have to deal with Forms with collection, edit the collection or delete the collection. Developers are confused on this topic as is evident from the postings in Struts mailing lists. The author does a great job of resolving the mystery surrounding editable collections in Forms. The author also does a great job of integrating the Pager Taglib from JSPTags.com with Struts and how a high performance page traversal mechanism can be set up based on the ValueListIterator pattern (Core J2EE Pattern) and database specific mechanisms.
Chapter 7 is a very decent way to learn Tiles. Tiles can be very confusing due to its capability to achieve the same thing in numerous ways. The author sticks to just one approach of using Tiles with Struts and defends why that is the best approach. The pros of this approach are there are confusions and the learning curve with Tiles is flattened. Coverage of Tiles Controller is missing and is desirable.
Chapter 9 on Exception handling in Struts deserves some mention. It is one of the best exception handling chapters I have ever read. Most other books on Struts limit their exception chapter to explaining differences between Checked v/s Unchecked exceptions and telling how the tags work in the struts-config.xml. The coverage of Exception handling in this book alone is worth the price of the book. It provides a solid framework to handle Exceptions in Struts, log them in a centralized manner and report and alert in a production environment.
Chapter 10 is for folks who want to customize Struts and reap its benefits in design and development of production systems. It presents four examples of how Struts can be effectively customized. The best among them was how to how to handle duplicate form submissions in a generic manner. We all have to deal with duplicate form submissions in daily life and handle them on use case basis by using the Synchronizer tokens. The technique illustrated here no doubt relies on the Sync token but uses it a very ingenious manner, presents a generic Action class. I liked this technique. Other techniques I liked are that the chapter provides a Dispatch Action like functionality for Image based form submission. The DispatchAction in Struts is great, unfortunately I can use it only under certain restrictions. One of them is that the all of the buttons have to have the same name. This technique removes that restriction and opens a world of possibilities for designing cleaner applications while providing enhanced user experience.
If there is a feature in Struts which is not the best way to attack a problem, this book tells you that. The chapters are also interspersed with design tips for designing your Struts application better. In summary, this is a pragmatic Struts book and a highly recommended read for developers and architects already familiar with Struts. You will certainly pick up quite a bit of Struts tricks that will help you design better Struts applications. If you architect, design and develop Struts based applications for your living, do yourself a favor - Go buy this book. Even if you don't know Struts, you can learn it fast with this book. The only requirement is that you should already know the basics of how to develop J2EE web applications.
You can purchase Struts Survival Guide: Basics to Best Practices from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.