You are previewing Beginning JSF™ 2 APIs and JBoss® Seam.
O'Reilly logo
Beginning JSF™ 2 APIs and JBoss® Seam

Book Description

The Enterprise Java™ platform, Java EE 6, is getting a facelift ... JavaServer™ Faces (JSF™) 2, is a big part of what's new in Java EE 6! JSF 2, a significant upgrade from JSF 1.2, now includes Facelets and integration/use options with a variety of web frameworks, including the popular JBoss® Seam and even the Spring Framework.

Beginning JSF™ 2 APIs and JBoss® Seam gets you up to speed with the new JSF 2.x API features and how they're implemented using the latest Seam web framework. This quick-start tutorial is the fastest way to get started on JSF 2, Facelets, and Seam, and with it you'll take the most useful features in the frameworks and apply them using best practices.

You'll learn to create and enhance an eShop using practical methods, and can repurpose the template for your own personal and professional projects.

Table of Contents

  1. Copyright
  2. About the Author
  3. About the Technical Reviewer
  4. 1. Getting Started with JSF
    1. 1.1. Introducing the "Hello world" Application
      1. 1.1.1. Installing Eclipse
      2. 1.1.2. Installing JBoss
      3. 1.1.3. Installing a JSF Implementation
      4. 1.1.4. Installing Web Beans
    2. 1.2. Creating the "Hello world!" Application with JSF
      1. 1.2.1. Generating Dynamic Content
      2. 1.2.2. Retrieving Data from Java Code
      3. 1.2.3. Exploring the Life Cycle of the Web Bean
      4. 1.2.4. Using an Easier Way to Output Text
    3. 1.3. Debugging a JSF Application
    4. 1.4. Summary
  5. 2. Using Forms
    1. 2.1. Developing a Stock Quote Application
      1. 2.1.1. Getting the Stock Quote Symbol
      2. 2.1.2. Displaying the Result Page
      3. 2.1.3. Displaying the Stock Value
      4. 2.1.4. Marking Input As Required
      5. 2.1.5. Inputting a Date
      6. 2.1.6. Conversion Errors and Empty Input
      7. 2.1.7. Using a Combo Box
      8. 2.1.8. Using a Single b2 Bean
      9. 2.1.9. Hooking Up the Web Beans
    2. 2.2. Summary
  6. 3. Validating Input
    1. 3.1. Developing a Postage Calculator
      1. 3.1.1. What If the Input Is Invalid?
      2. 3.1.2. Null Input and Validators
      3. 3.1.3. Validating the Patron Code
      4. 3.1.4. Creating a Custom Validator for the Patron Code
      5. 3.1.5. Displaying the Error Messages in Red
      6. 3.1.6. Displaying the Error Message Along with the Field
      7. 3.1.7. Validating a Combination of Multiple Input Values
    2. 3.2. Summary
  7. 4. Creating an E-shop
    1. 4.1. Listing the Products
    2. 4.2. Making the Link to Show the Details
    3. 4.3. Displaying Headers in the Columns
    4. 4.4. Implementing a Shopping Cart
    5. 4.5. Displaying the Content of the Shopping Cart
    6. 4.6. The Checkout Function
    7. 4.7. Getting the Credit Card Number of the Current User
    8. 4.8. Forcing the User to Log In
    9. 4.9. Implementing Logout
    10. 4.10. Protecting the Password
    11. 4.11. Summary
  8. 5. Creating Custom Components
    1. 5.1. Displaying a Copyright Notice on Multiple Pages
    2. 5.2. Allowing the Caller to Specify the Company Name
    3. 5.3. Creating a Product Editor
    4. 5.4. Passing a Method in a Parameter?
    5. 5.5. Creating a Box Component
    6. 5.6. Accepting Two Pieces of XHTML Code
    7. 5.7. Creating a Reusable Component Library
    8. 5.8. Creating a Component Library Without taglib.xml
    9. 5.9. Summary
  9. 6. Providing a Common Layout for Your Pages
    1. 6.1. Using the Same Menu on Different Pages
    2. 6.2. Using Global Navigation Rules
    3. 6.3. Using Two Abstract Parts
    4. 6.4. Creating Page-Specific Navigation Cases
    5. 6.5. Summary
  10. 7. Building Interactive Pages with Ajax
    1. 7.1. Displaying a FAQ
    2. 7.2. Refreshing the Answer Only
    3. 7.3. Hiding and Showing the Answer
    4. 7.4. Using Ajax to Hide or Show the Answer
    5. 7.5. Giving a Rating to a Question
    6. 7.6. Updating the Rating as the User Types
    7. 7.7. Using a Dialog Box to Get the Rating
    8. 7.8. Setting the Look and Feel with Skins
    9. 7.9. Displaying Multiple Questions
    10. 7.10. Summary
  11. 8. Using Conversations
    1. 8.1. Creating a Wizard to Submit Support Tickets
    2. 8.2. Interference Between Browser Windows
    3. 8.3. URL Mismatched?
    4. 8.4. Summary
  12. 9. Supporting Other Languages
    1. 9.1. Displaying the Current Date and Time
    2. 9.2. Supporting Chinese
    3. 9.3. Easier Way to Access Map Elements
    4. 9.4. Internationalizing the Date Display
    5. 9.5. Letting the User Change the Language Used
    6. 9.6. Localizing the Full Stop
    7. 9.7. Displaying a Logo
    8. 9.8. Making the Locale Change Persistent
    9. 9.9. Localizing Validation Messages
    10. 9.10. Summary
  13. 10. Using JBoss Seam
    1. 10.1. Installing Seam
    2. 10.2. Re-creating the E-shop Project
    3. 10.3. Allowing the User to Add Products
    4. 10.4. Restricting Access to the Product-Editing Page
    5. 10.5. Creating a Shopping Cart
    6. 10.6. Turning the Shopping Cart into a Stateful Session Bean
    7. 10.7. Creating the Checkout Page
    8. 10.8. Using WebLogic, WebSphere, or GlassFish
    9. 10.9. Summary