Seam in Action
Dan Allen
Foreword by Norman Richards
  • September 2008
  • ISBN 9781933988405
  • 624 pages
  • printed in black & white

"Seam in Action" captures the spirit of Seam and shows you how to use it the way we on the Seam team intended.

Norman Richards, Red Hat

Seam in Action offers a practical and in-depth look at Seam from outside the walls of RedHat/JBoss. The book puts Seam head-to-head with the complexities in the Java EE architecture. It discusses the shortcomings of JSF, the challenges of using Java persistence in the web environment, and other common development roadblocks, then shows how Seam makes these problems just melt away. In covering Seam, the author doesn't just ask you to sprinkle annotations on your code and expect that you understand how it works. Instead, the author lays down the facts, shows you the steps, reveals the logic, and diagrams the flow, so that by the end of the book, you will not only have gained a deep understanding of Seam, but will also come away ready to teach the material to others.

Table of Contents show full

foreword

preface

acknowledgments

about this book

about the cover illustration

Part 1 Teeing off with Seam

1. Seam unifies Java EE

1.1. Which framework should I use?

1.2. Seam’s approach to unification

1.3. Your first swings with Seam

1.4. Seam’s core competencies

1.5. Summary

2. Putting seam-gen to work

2.1. The Open 18 prototype

2.2. Letting seam-gen do the initial work

2.3. Kick off your project with seam-gen

2.4. Deploying the project to JBoss AS

2.5. Show and tell, change, and repeat

2.6. Rapidly developing a seam-gen project

2.7. Summary

Part 2 Seam fundamentals

3. The Seam life cycle

3.1. Exploring how Seam participates in a request

3.2. The JSF life cycle sans Seam

3.3. Seam’s page-oriented life-cycle additives

3.4. Combining page actions with navigation

3.5. The JSF life cycle with Seam

3.6. A try-catch block around the life cycle

3.7. Summary

4. Components and contexts

4.1. Seam’s contextual naming container

4.2. Sorting out components

4.3. Defining components using annotations

4.4. A comprehensive component example

4.5. A component’s life

4.6. Using EJB 3 session beans in Seam

4.7. Accessing components

4.8. Summary

5. The Seam component descriptor

5.1. Defining components using XML

5.2. XML namespaces in the component descriptor

5.3. Configuring component properties

5.4. Component definitions vs. component configuration

5.5. Configuring and enabling built-in components

5.6. Summary

6. Absolute inversion of control

6.1. Bijection: dependency injection evolved

6.2. Dynamic dependency @In-jection

6.3. @Out-jecting context variables

6.4. Bypassing bijection

6.5. Component events

6.6. Custom method interceptors

6.7. Factory and manager components

6.8. Summary

Part 3 Seam’s state management

7. The conversation: Seam’s unit of work

7.1. Learning to appreciate conversational state

7.2. The conversation context

7.3. Establishing conversation boundaries

7.4. Putting the conversation aside

7.5. Switching between conversations

7.6. Driving the conversation with a page flow

7.7. Ad hoc conversations

7.8. Summary

8. Understanding Java persistence

8.1. Java persistence principles

8.2. Entities and relationships

8.3. The persistence unit

8.4. The persistence manager

8.5. Transactions

8.6. Managing persistence in the enterprise

8.7. Choosing between JPA and Hibernate

8.8. Summary

9. Seam-managed persistence and transactions

9.1. Getting persistence context management right

9.2. Enhancing the capabilities of the persistence manager

9.3. Setting up a persistence unit in Seam

9.4. Seam’s transaction support

9.5. Summary

10. Rapid Seam development

10.1. A framework within a framework

10.2. Stateful CRUD using the Home component

10.3. Providing feedback

10.4. Smarter queries with the Query component

10.5. Summary

Part 4 Sinking the business requirements

11. Securing Seam applications

11.1. Authentication jump-start

11.2. Securing pages

11.3. Role-based authorization

11.4. Rule-based authorization using Drools

11.5. Separating the computers from the humans

11.6. Summary

12. Ajax and JavaScript remoting

12.1. Using Ajax with JSF

12.2. Partial form submits

12.3. Ajax Push with ICEfaces

12.4. JavaScript remoting to Seam

12.5. Conversational remoting calls

12.6. Responding to GWT remoting calls

12.7. Summary

13. File, rich rendering, and email support

13.1. Uploading files and rendering dynamic images

13.2. PDF generation with iText

13.3. Quick and easy charting with JFreeChart

13.4. Composing email the Seam way

13.5. Customizing the UI with resource bundles

13.6. Summary

© 2014 Manning Publications Co.

About the Technology

Seam is an exciting new application framework based on the Java EE platform that you can use to build rich, web-based business applications. Seam is rapidly capturing the interest of Java enterprise developers because of its focus on simplicity, ease of use, transparent integration, scalability, and developer choice.

About the book

All too often, developers spend a majority of their time integrating disparate technologies, manually tracking state, struggling to understand JSF, wrestling with Hibernate exceptions, and constantly redeploying applications, rather than on the logic pertaining to the business at hand. Seam in Action dives deep into thorough explanations of how Seam eliminates these non-core tasks by leveraging configuration by exception, Java 5 annotations, and aspect-oriented programming.

To start off, you will see a working Java EE-compliant application come together by the end of the second chapter. As you progress through the book, you will discover how Seam eliminates unnecessary layers and configurations and uses an inversion of control technical known as bijection supplemented by a liberal use of the Unified Expression Language (EL) to establish the missing link between JSF, EJB 3 and JavaBean components. You also witness how Seam opens doors for you to incorporate technologies you previously have not had time to learn, such as business processes and stateful page flows (jBPM), rule-based security, Ajax remoting, PDF generation, Spring integration, and more.

What's inside

  • Get started with Seam using seam-gen
  • Clarifies the inner workings of bijection
  • Breaks down all the Seam annotations
  • Covers integration with Spring 2.0
  • Shows how to make your applications rich (and hopefully you too!)
  • Depth beyond what is found in the reference documentation

About the author

Dan Allen is a passionate enterprise software developer, scholar, and mentor. For Dan, the end game is to be a mentor, and writing is one medium he uses to pursue that goal. Dan has over eight years of development experience using technologies that include Java frameworks (Seam, JSF, EJB3, Hibernate, Spring, Struts), testing frameworks (JUnit, TestNG), JavaScript and DOM scripting, CSS and page layouts, Maven 2, Ant, Groovy, as well as a wealth of other technologies not mentioned. Dan is also a dedicated open source advocate, and is very proud, and not a tad bit shy, about the fact that he has been running Linux, and only Linux, since the turn of the millennium. Dan's professional passions are equally divided between Java and Linux, with a hint of other technologies mixed in.


combo $44.99 pBook + eBook
eBook $35.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks

Open this book first! An excellent resource.

Peter Johnson, author of "JBoss in Action"

Explains, teaches, and instills confidence.

Peter Pavlovich, Kronos Inc.

...explains all technical aspects and the rationale of Seam's design.

Michael Smolyak, DataSource, Inc.

I've read all Seam books and still learned a lot from this one.

Kevin P. Galligan, Medical Research Forum

Essential!

Ted Goddard, ICEfaces.org

Easy to read, easy to understand - the best way to get going.

Nikolaos Kaintantzisl, Zühlke Engineering