Part 4. Sinking the business requirements – Seam in Action

Part 4. Sinking the business requirements

Seam goes well beyond being simply a web application framework. It gives you support to cover all the business requirements, which you’ll learn to appreciate in this part of the book.

Chapter 11 shows how quickly you can weave security into a Seam application. A single method on a POJO gives you both authentication and role-based authorization. You use annotations and the EL to define restrictions. Going deeper, you’ll get a crash course in the Drools rule engine and use it to create fine-grained, contextual restrictions. Finally, you’ll learn to keep out pesky spammers and bots using CAPTCHA, a nearly zero-effort integration.

Though critical, security can often be a dry topic. But everyone loves Ajax! Chapter 12 highlights the two flavors of Ajax in a Seam application. First you’ll study Ajax-enabled UI components, which honor the JSF life cycle and let you avoid the JavaScript and CSS nightmares that typically come with adopting Ajax. If you prefer the low-level control, the JavaScript Remoting library lets you interact directly with server-side components from JavaScript, stepping outside of the JSF life cycle. The latter approach opens the door to alternative front ends such as GWT.

If this book is a full-course meal, then Chapter 13 is definitely dessert. This is the chapter where you’ll learn to make your application pop. It begins by showing how to accept file uploads using a JSF input binding. You’ll then discover the versatility of Facelets templates to create and serve PDF documents, compose and send email messages with attachments, and produce RSS. Finally, you’ll learn to use themes and i18n to customize the application.

That’s where the book ends and the online chapters pick up. Chapter 14 eases you into Seam’s business process integration and shows that a business process is simply a multiuser conversation, controlled using the same declarative approach as a single-user conversation. Chapter 15 reveals how Seam taps into the Spring container. The Spring integration is vital because it allows Spring to leverage Seam’s proper management of the persistence context.

The underlying theme of this final part is that Seam’s programming model remains consistent, regardless of which integration you use, making the technologies accessible.