Home > Store

Seam Framework: Experience the Evolution of Java EE, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

Seam Framework: Experience the Evolution of Java EE, 2nd Edition

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2009
  • Edition: 2nd
  • Book
  • ISBN-10: 0-13-712939-4
  • ISBN-13: 978-0-13-712939-3

Fully Updated to Cover Major Enhancements to Seam 2.x

In Seam Framework, Second Edition, the authors of the leading guide to Seam programming have systematically updated their text to reflect the major improvements introduced with Seam 2.x. This author team–all key Seam project contributors–teach Seam 2.x through detailed example applications that reveal how Seam simplifies many tasks that were previously difficult or impractical. Their robust descriptions are complemented by in-depth feature discussions that demonstrate how to use Seam’s power to the fullest. Whether you’re new to Seam programming or a seasoned Seam developer who wants to achieve deeper mastery of Seam 2.x, this book will be an indispensable resource.

Coverage includes

  • Using improvements to Seam’s conversation model, transaction management, and other features
  • Enhancing security, performing end-to-end validation, and providing custom exception pages
  • Using Quartz to execute timer jobs in your application
  • Generating bookmarkable RESTful Web pages the easy way
  • Developing highly scalable applications with Seam 2.x’s new multilayer caching
  • Simplifying development with Groovy, the scripting language that runs directly on the JVM
  • Using jBPM business processes to improve page flow
  • Previewing Web Beans (JSR-299), the future core of Seam that will transform Java EE Web development

*Download source code for this book’s case study application at solutionsfit.com/seam.

Extras

Web Resources

Please visit jboss.com for additional resources.

Sample Content

Online Sample Chapter

Recommended JSF Enhancements

Table of Contents

About This Book xvii

About the Authors xix

Acknowledgments xxi

Part I: Getting Started 1

Chapter 1: What Is Seam? 3

1.1: Integrating and Enhancing Java EE Frameworks 4

1.2: A Web Framework That Understands ORM 5

1.3: Supporting Stateful Web Applications 6

1.4: Web 2.0 Ready 7

1.5: POJO Services via Dependency Bijection 7

1.6: Convention over Configuration 8

1.7: Avoiding XML Abuse 8

1.8: Designed for Testing 9

1.9: Great Tools Support 10

1.10: Let’s Start Coding! 10

Chapter 2: Seam Hello World 11

2.1: Create a Data Model 13

2.2: Map the Data Model to a Web Form 13

2.3: Handle Web Events 14

2.4: Navigate to the Next Page 15

2.5: EJB3 Bean Interface and Mandatory Method 16

2.6: More on the Seam Programming Model 17

2.7: Configuration and Packaging 20

2.8: How Is This Simple? 25

Chapter 3: Recommended JSF Enhancements 27

3.1: An Introduction to Facelets 28

3.2: Seam JSF Enhancements 34

3.3: Add Facelets and Seam UI Support 38

3.4: PDF, Email, and Rich Text 40

3.5: Internationalization 46

Chapter 4: Seam without EJB3 47

4.1: A Seam POJO Example 47

4.2: Configuration 48

4.3: Packaging 50

4.4: POJO Trade-Offs 52

Chapter 5: Rapid Application Development Tools 53

5.1: Prerequisites 54

5.2: A Quick Tutorial 54

5.3: Working with IDEs 63

5.4: Generating a CRUD Application from a Database 72

5.5: Seam-gen Command Reference 73

Part II: Stateful Applications Made Easy 75

Chapter 6: An Introduction to Stateful Framework 77

6.1: Correct Usage of ORM 77

6.2: Better Performance 79

6.3: Better Browser Navigation Support 81

6.4: Fewer Memory Leaks 82

6.5: High Granularity Component Lifecycle 83

6.6: Reducing Boilerplate Code 84

Chapter 7: Thinking in Components 87

7.1: Stateful Components 87

7.2: Managing Stateful Components 92

7.3: Configuring Components through XML 97

7.4: Page Navigation Flow 99

Chapter 8: Conversations 101

8.1: What Is a Conversation? 102

8.2: Long-Running Conversations 106

8.3: Managing Long-Running Conversations 112

8.4: New Frontiers 124

Chapter 9: Workspaces and Concurrent Conversations 125

9.1: What Is a Workspace? 125

9.2: Workspace Management 129

9.3: Natural Conversations 134

9.4: Workspace Timeout 140

9.5: Desktop Features in a Stateless Web 143

Chapter 10: Nested Conversations 145

10.1: Why Are Nested Conversations Needed? 145

10.2: Continuing the Conversation 147

10.3: The Conversation Stack 152

10.4: Fine-Grained State Management 157

Chapter 11: Transactions and Persistence 159

11.1: Seam-Managed Transactions 160

11.2: Atomic Conversation (Web Transaction) 165

Part III: Integrating Web and Data Components 175

Chapter 12: Validating Input Data 177

12.1: Form Validation Basics 177

12.2: Validation Annotations on Entity Beans 179

12.3: Triggering the Validation Action 181

12.4: Displaying Error Messages on the Web Form 183

12.5: Using JSF Custom Validators 185

Chapter 13: Clickable Data Tables 187

13.1: Implementing a Clickable Data Table 188

13.2: Seam Data-Binding Framework 191

Chapter 14: Decoupling Components Using Events 193

14.1: The Observer Pattern 193

14.2: Component-Driven Events 196

Chapter 15: Bookmarkable Web Pages 203

15.1: Using Page Parameters 204

15.2: The Java-Centric Approach 207

15.3: RESTful Web Services 211

Chapter 16: The Seam CRUD Application Framework 213

16.1: Data Access Objects (DAOs) 213

16.2: Seam CRUD DAOs Are POJOs 214

16.3: A Declarative Seam DAO Component 215

16.4: Queries 218

Chapter 17: Failing Gracefully 223

17.1: Why Not Standard Servlet Error Pages? 223

17.2: Setting Up the Exception Filter 225

17.3: Annotating Exceptions 225

17.4: Using pages.xml for System Exceptions 227

17.5: The Debug Information Page 229

Chapter 18: Seam Security 233

18.1: Authentication and User Roles 234

18.2: Declarative Access Control 237

18.3: Identity Management 243

18.4: Additional Security Features 251

Part IV: AJAX Support 257

Chapter 19: Custom and AJAX UI Components 259

19.1: Autocompletion Text Input Example 261

19.2: Rich Input Control Examples 263

19.3: A Scrollable Data Table 264

19.4: Using RichFaces with Seam 265

19.5: Other JSF Component Libraries 266

Chapter 20: Enabling AJAX for Existing Components 269

20.1: AJAX Validator Example 270

20.2: Programmatic AJAX 272

20.3: AJAX Buttons 274

20.4: AJAX Containers 276

20.5: Other Goodies 276

20.6: Using Ajax4jsf with Seam 277

20.7: Pros and Cons 278

Chapter 21: Direct JavaScript Integration 279

21.1: AJAX Validator Example (Reloaded) 280

21.2: AJAX Progress Bar 284

21.3: Integrating the Dojo Toolkit 287

Part V: Business Processes and Rules 293

Chapter 22: Rule-Based Security Framework 295

22.1: Rule-Based Access Control 295

22.2: Configuring Rule-Based Permissioning 296

22.3: Simple Access Rules 297

22.4: Per-Instance Access Rules 299

22.5: Securing Your Entities 302

Chapter 23: Integrating Business Rules in Web Applications 305

23.1: Embedded Rules 305

23.2: Generic Rules 309

23.3: Building and Deployment 312

23.4: Conclusions 313

Chapter 24: Managing Business Processes 315

24.1: jBPM Concepts and Vocabulary 316

24.2: Application Users and jBPM Actors 318

24.3: Creating a Business Process 320

24.4: Managing Tasks 325

24.5: Business Process-Based Page Navigation Flow 330

24.6: jBPM Libraries and Configuration 333

Chapter 25: Integrating Business Processes and Rules 335

25.1: The Process 335

25.2: The Rules 337

25.3: Conclusions 338

Part VI: Testing Seam Applications 339

Chapter 26: Unit Testing 341

26.1: A Simple TestNG Test Case 343

26.2: Simulating Dependency Bijection 344

26.3: Mocking the Database and Transaction 345

26.4: Loading the Test Infrastructure 347

Chapter 27: Integration Testing 351

27.1: Simulating JSF Interactions 352

27.2: Using JSF EL Expressions 353

27.3: Transactional Data Source 355

Part VII: Production Deployment 357

Chapter 28: Using a Production Database 359

28.1: Installing and Setting Up the Database 359

28.2: Installing the Database Driver 361

28.3: Defining a Data Source 361

28.4: Configuring the Persistence Engine 362

28.5: How about Tomcat? 362

Chapter 29: Java EE 5.0 Deployment 365

29.1: JBoss AS 4.0.5 365

29.2: JBoss AS 4.2.x and 5.x 366

29.3: GlassFish 367

Chapter 30: Performance Tuning and Clustering 371

30.1: Tuning Performance on a Single Server 372

30.2: Clustering for Scalability and Failover 379

Part VIII: Emerging Technologies 383

Chapter 31: Scheduling Recurring Jobs from a Web Application 385

31.1: Simple Recurring Events 386

31.2: Configuring the Quartz Scheduler Service 387

31.3: Scheduling Cron Jobs 389

31.4: Scheduling Jobs When Starting Up 390

31.5: Conclusion 391

Chapter 32: Improving Scalability with Multilayered Caching 393

32.1: Multilayered Caching 394

32.2: Integrating a Cache Provider through Seam 396

32.3: Simplified Caching with Seam 398

Chapter 33: Making Seam Groovy 401

33.1: Groovy Entities 402

33.2: Groovy Actions 405

33.3: Integrating Groovy 406

Chapter 34: Introduction to Web Beans 409

34.1: Defining a Web Beans Component 410

34.2: Component Injection 411

34.3: Producer Methods 414

34.4: The Context Model 416

34.5: Component Stereotyping 419

34.6: Implementing Cross-Cutting Behavior 421

34.7: Conclusion 423

Appendix A: Installing and Deploying JBoss AS 425

A.1: JDK 5.0 Is Required 425

A.2: Installing JBoss AS 426

A.3: Deploying and Running Applications 426

Appendix B: Using Example Applications as Templates 427

B.1: Simple EJB3-Based Web Applications 428

B.2: POJO-Based Web Applications 433

B.3: More Complex Applications 438

Appendix C: Using Maven 441

Appendix D: Direct Access to the Hibernate API 451

D.1: Using the Hibernate API 451

D.2: Configuration 453

Index 455

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020