JBoss Enterprise Application Platform - Red Hat .JBoss Enterprise Application Platform 5 Seam Reference

  • View
    218

  • Download
    0

Embed Size (px)

Text of JBoss Enterprise Application Platform - Red Hat .JBoss Enterprise Application Platform 5 Seam...

  • JBoss Enterprise Application Platform5

    Seam Reference Guide

    for use with JBoss Enterprise Application Platform 5Edition 5.2.0

    Last Updated: 2017-10-13

  • JBoss Enterprise Application Platform 5 Seam Reference Guide

    for use with JBoss Enterprise Application Platform 5Edition 5.2.0

    Gavin King

    Pete Muir

    Norman Richards

    Shane Bryzak

    Michael Yuan

    Mike Youngstrom

    Christian Bauer

    Jay Balunas

    Dan Allen

    Max Andersen

    Emmanuel Bernard

    Nicklas Karlsson

    Daniel Roth

    Matt Drees

    Jacob Orshalick

    Marek Novotny

    Edited by

    Elspeth Thorne

    Eva Kopalova

    Laura Bailey

    Petr Penicka

    Russell Dickenson

    Samson Kittoli

    Scott Mumford

  • Legal Notice

    Copyright 2012 Red Hat, Inc.

    This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0Unported License. If you distribute this document, or a modified version of it, you must provideattribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hattrademarks must be removed.

    Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert,Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.

    Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinitylogo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and othercountries.

    Linux is the registered trademark of Linus Torvalds in the United States and other countries.

    Java is a registered trademark of Oracle and/or its affiliates.

    XFS is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United Statesand/or other countries.

    MySQL is a registered trademark of MySQL AB in the United States, the European Union andother countries.

    Node.js is an official trademark of Joyent. Red Hat Software Collections is not formally related toor endorsed by the official Joyent Node.js open source or commercial project.

    The OpenStack Word Mark and OpenStack logo are either registered trademarks/service marksor trademarks/service marks of the OpenStack Foundation, in the United States and other countriesand are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed orsponsored by the OpenStack Foundation, or the OpenStack community.

    All other trademarks are the property of their respective owners.

    Abstract

    This book is a Reference Guide for JBoss Enterprise Application Platform 5 and its patch releases.

    http://creativecommons.org/licenses/by-sa/3.0/

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Table of Contents

    CHAPTER 1. SEAM TUTORIAL1.1. USING THE SEAM EXAMPLES

    1.1.1. Running the examples on JBoss Enterprise Application Platform1.1.2. Running the example tests

    1.2. YOUR FIRST SEAM APPLICATION: THE REGISTRATION EXAMPLE1.2.1. Understanding the code

    1.2.1.1. The entity bean: User.java1.2.1.2. The stateless session bean class: RegisterAction.java1.2.1.3. The session bean local interface: Register.java1.2.1.4. The view: register.xhtml and registered.xhtml1.2.1.5. The Seam component deployment descriptor: components.xml1.2.1.6. The web deployment description: web.xml1.2.1.7. The JSF configuration: faces-config.xml1.2.1.8. The EJB deployment descriptor: ejb-jar.xml1.2.1.9. The EJB persistence deployment descriptor: persistence.xml1.2.1.10. The EAR deployment descriptor: application.xml

    1.2.2. How it works1.3. CLICKABLE LISTS IN SEAM: THE MESSAGES EXAMPLE

    1.3.1. Understanding the code1.3.1.1. The entity bean: Message.java1.3.1.2. The stateful session bean: MessageManagerBean.java1.3.1.3. The session bean local interface: MessageManager.java1.3.1.4. The view: messages.jsp

    1.3.2. How it works1.4. SEAM AND JBPM: THE TODO LIST EXAMPLE

    1.4.1. Understanding the code1.4.2. How it works

    1.5. SEAM PAGEFLOW: THE NUMBERGUESS EXAMPLE1.5.1. Understanding the code1.5.2. How it works

    1.6. A COMPLETE SEAM APPLICATION: THE HOTEL BOOKING EXAMPLE1.6.1. Introduction1.6.2. Overview of the booking example1.6.3. Understanding Seam conversations1.6.4. The Seam Debug Page

    1.7. NESTED CONVERSATIONS: EXTENDING THE HOTEL BOOKING EXAMPLE1.7.1. Introduction1.7.2. Understanding Nested Conversations

    1.8. A COMPLETE APPLICATION FEATURING SEAM AND JBPM: THE DVD STORE EXAMPLE1.9. BOOKMARKABLE URLS WITH THE BLOG EXAMPLE

    1.9.1. Using "pull"-style MVC1.9.2. Bookmarkable search results page1.9.3. Using "push"-style MVC in a RESTful application

    CHAPTER 2. MIGRATION2.1. MIGRATING FROM SEAM 1.2.X TO SEAM 2.0

    2.1.1. Migrating to JavaServer Faces 1.22.1.2. Code Migration2.1.3. Migrating components.xml2.1.4. Migrating to Embedded JBoss2.1.5. Migrating to jBPM 3.2

    14141414151515172020212223232424252626262730303131323839394647474949575758596566676971

    75757576777878

    Table of Contents

    1

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.1.6. Migrating to RichFaces 3.12.1.7. Changes to Components

    2.2. MIGRATING FROM SEAM 2.0 TO SEAM 2.1 OR 2.22.2.1. Changes to dependency jar names2.2.2. Changes to Components

    CHAPTER 3. GETTING STARTED WITH SEAM-GEN3.1. BEFORE YOU START3.2. SETTING UP A NEW PROJECT3.3. CREATING A NEW ACTION3.4. CREATING A FORM WITH AN ACTION3.5. GENERATING AN APPLICATION FROM AN EXISTING DATABASE3.6. GENERATING AN APPLICATION FROM EXISTING JPA/EJB3 ENTITIES3.7. DEPLOYING THE APPLICATION AS AN EAR3.8. SEAM AND INCREMENTAL HOT DEPLOYMENT

    CHAPTER 4. GETTING STARTED WITH JBOSS DEVELOPER STUDIO4.1. HOT DEPLOYMENT WITH JBOSS DEVELOPER STUDIO

    CHAPTER 5. THE CONTEXTUAL COMPONENT MODEL5.1. SEAM CONTEXTS

    5.1.1. Stateless context5.1.2. Event context5.1.3. Page context5.1.4. Conversation context5.1.5. Session context5.1.6. Business process context5.1.7. Application context5.1.8. Context variables5.1.9. Context search priority5.1.10. Concurrency model

    5.2. SEAM COMPONENTS5.2.1. Stateless session beans5.2.2. Stateful session beans5.2.3. Entity beans5.2.4. JavaBeans5.2.5. Message-driven beans5.2.6. Interception5.2.7. Component names5.2.8. Defining the component scope5.2.9. Components with multiple roles5.2.10. Built-in components

    5.3. BIJECTION5.4. LIFE CYCLE METHODS5.5. CONDITIONAL INSTALLATION5.6. LOGGING5.7. THE MUTABLE INTERFACE AND @READONLY5.8. FACTORY AND MANAGER COMPONENTS

    CHAPTER 6. CONFIGURING SEAM COMPONENTS6.1. CONFIGURING COMPONENTS VIA PROPERTY SETTINGS6.2. C