1. Trang chủ
  2. » Công Nghệ Thông Tin

javaserver faces in action

1.1K 4.8K 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • foreword

  • preface

  • acknowledgments

  • about this book

    • How to use this book

    • References

    • Conventions

    • Source code and the online extension

    • Author Online

    • About the author

  • about the title and cover

    • About the title

    • About the cover illustration

  • Part 1 - Exploring JavaServer Faces

    • Introducing JavaServer Faces

      • 1.1 It’s a RAD-ical world

        • 1.1.1 So, what is JavaServer Faces?

        • 1.1.2 Industry support

      • 1.2 The technology under the hood

        • 1.2.1 Hypertext Transfer Protocol (HTTP)

        • 1.2.2 Servlets

        • 1.2.3 Portlets

        • 1.2.4 JavaBeans

        • 1.2.5 JSP and other display technologies

      • 1.3 Frameworks, frameworks, frameworks

        • 1.3.1 Why do we need frameworks?

        • 1.3.2 She’s a Model 2

        • 1.3.3 JSF, Struts, and other frameworks

      • 1.4 Components everywhere

      • 1.5 Hello, world!

        • 1.5.1 Dissecting hello.jsp

        • 1.5.2 Dissecting goodbye.jsp

        • 1.5.3 Examining the HelloBean class

        • 1.5.4 Configuration with faces-config.xml

        • 1.5.5 Configuration with web.xml

      • 1.6 Summary

    • JSF fundamentals

      • 2.1 The key pieces of the pie

        • 2.1.1 User interface components

        • 2.1.2 Renderers

        • 2.1.3 Validators

        • 2.1.4 Backing beans

        • 2.1.5 Converters

        • 2.1.6 Events and listeners

        • 2.1.7 Messages

        • 2.1.8 Navigation

      • 2.2 The Request Processing Lifecycle

        • 2.2.1 Phase 1: Restore View

        • 2.2.2 Phase 2: Apply Request Values

        • 2.2.3 Phase 3: Process Validations

        • 2.2.4 Phase 4: Update Model Values

        • 2.2.5 Phase 5: Invoke Application

        • 2.2.6 Phase 6: Render Response

      • 2.3 Understanding component and client identifiers

        • 2.3.1 Naming containers

        • 2.3.2 Referencing identifiers

      • 2.4 Exploring the JSF expression language

        • 2.4.1 Understanding scoped variables

        • 2.4.2 Using implicit variables

        • 2.4.3 Using the EL with components

      • 2.5 Summary

    • Warming up: getting around JSF

      • 3.1 Setting up your JSF environment

        • 3.1.1 Basic requirements

        • 3.1.2 Choosing a JSF implementation

        • 3.1.3 Directory structure

        • 3.1.4 Configuration

      • 3.2 The role of JSP

        • 3.2.1 Using JSP includes

        • 3.2.2 Using JSF with JSTL and other JSP custom tags

      • 3.3 Creating and initializing beans

        • 3.3.1 Declaring managed beans

        • 3.3.2 Declaring Lists and Maps as managed beans

        • 3.3.3 Setting values with value-binding expressions

      • 3.4 Navigating the sea of pages

      • 3.5 Summary

    • Getting started with the standard components

      • 4.1 It’s all in the components

        • 4.1.1 Using HTML attributes

        • 4.1.2 Understanding facets

        • 4.1.3 The power of tools

        • 4.1.4 The render kit behind the scenes

      • 4.2 Common component properties

      • 4.3 Controlling the page with UIViewRoot

      • 4.4 Setting component parameters with UIParameter

      • 4.5 Displaying data with the Output components

        • 4.5.1 Displaying ordinary text with HtmlOutputText

        • 4.5.2 Using UIOutput with the <f:verbatim> tag

        • 4.5.3 Creating input labels with HtmlOutputLabel

        • 4.5.4 Using HtmlOutputFormat for parameterized text

        • 4.5.5 Displaying hyperlinks with HtmlOutputLink

      • 4.6 Displaying images with HtmlGraphicImage

      • 4.7 Displaying component messages with HtmlMessage

      • 4.8 Displaying application messages with HtmlMessages

      • 4.9 Grouping and layout with the Panel components

        • 4.9.1 Grouping components with HtmlPanelGroup

        • 4.9.2 Creating tables with HtmlPanelGrid

      • 4.10 Summary

    • Using the input and data table components

      • 5.1 Registering event listeners

        • 5.1.1 Declaring value-change listeners

        • 5.1.2 Declaring action listeners

      • 5.2 Common component properties

      • 5.3 Handling forms with HtmlForm

      • 5.4 Handling basic user input

        • 5.4.1 Declaring basic text fields with HtmlInputText

        • 5.4.2 Using HtmlInputTextarea for memo fields

        • 5.4.3 Displaying password fields with HtmlInputSecret

        • 5.4.4 Declaring hidden fields with HtmlInputHidden

      • 5.5 Using HtmlSelectBooleanCheckbox for checkboxes

      • 5.6 Defining item lists

        • 5.6.1 Using UISelectItem for single items

        • 5.6.2 Using UISelectItems for multiple items

      • 5.7 Handling multiple-item selections

        • 5.7.1 Using HtmlSelectManyCheckbox for checkbox groups

        • 5.7.2 Displaying listboxes with HtmlSelectManyListbox

        • 5.7.3 Using HtmlSelectManyMenu for single-item listboxes

      • 5.8 Handling single-item selections

        • 5.8.1 Using HtmlSelectOneRadio for radio button groups

        • 5.8.2 Using single-select listboxes with HtmlSelectOneListbox

        • 5.8.3 Declaring combo boxes with HtmlSelectOneMenu

      • 5.9 Executing application commands

        • 5.9.1 Declaring buttons with HtmlCommandButton

        • 5.9.2 Creating an action link with HtmlCommandLink

      • 5.10 Displaying data sets with HtmlDataTable

      • 5.11 Summary

    • Internationalization, validators, and converters

      • 6.1 Internationalization and localization

        • 6.1.1 Looking into locales

        • 6.1.2 Creating resource bundles

        • 6.1.3 Using resource bundles with components

        • 6.1.4 Internationalizing text from back-end code

      • 6.2 Input validation

        • 6.2.1 Using validator methods

        • 6.2.2 Using validators

        • 6.2.3 Using the standard validators

        • 6.2.4 Combining different validators

      • 6.3 Type conversion and formatting

        • 6.3.1 Using converters

        • 6.3.2 Working with the standard converters

      • 6.4 Customizing application messages

      • 6.5 Summary

  • Part 2 - Building user interfaces

    • Introducing ProjectTrack

      • 7.1 Requirements

      • 7.2 The conceptual model

      • 7.3 User interface

      • 7.4 Development team

      • 7.5 Summary

    • Developing a user interface without Java code: the Login page

      • 8.1 Getting started

        • 8.1.1 Setting up web.xml

        • 8.1.2 Setting up faces-config.xml

      • 8.2 Creating the Login page

        • 8.2.1 Starting with HtmlGraphicImage and HtmlOutputText components

        • 8.2.2 Adding a form

      • 8.3 Sprucing things up

        • 8.3.1 Using an image for the button

        • 8.3.2 Integrating with JavaScript

        • 8.3.3 Adding Cascading Style Sheets

      • 8.4 Adding validators

        • 8.4.1 Customizing validation messages

      • 8.5 Improving layout with HtmlPanelGrid

      • 8.6 Summary

    • Developing a user interface without Java code: the other pages

      • 9.1 Building the header with a custom component

        • 9.1.1 Using a custom toolbar component

        • 9.1.2 Configuring the navigation rule

      • 9.2 Prototyping data tables with panels

        • 9.2.1 The Inbox page

        • 9.2.2 Configuring the navigation rule

        • 9.2.3 The Show All page

        • 9.2.4 Configuring the navigation rule

      • 9.3 Creating input forms

        • 9.3.1 The Approve a Project page

        • 9.3.2 Configuring the navigation rule

        • 9.3.3 The Reject a Project page

        • 9.3.4 Configuring the navigation rule

        • 9.3.5 The Create a Project page

        • 9.3.6 Configuring the navigation rule

      • 9.4 The Project Details page

        • 9.4.1 Configuring the navigation rule

      • 9.5 Summary

    • Integrating application functionality

      • 10.1 Understanding JSF development approaches

      • 10.2 Exploring the application environment

      • 10.3 Reorganizing pages for security

      • 10.4 The Login page

        • 10.4.1 Updating the navigation rule

      • 10.5 The header

        • 10.5.1 Updating the navigation rule

      • 10.6 Integrating data grids

        • 10.6.1 The Inbox page

        • 10.6.2 The Show All page

      • 10.7 Integrating input forms

        • 10.7.1 Updating the includes

        • 10.7.2 The Approve a Project page

        • 10.7.3 The Reject a Project page

        • 10.7.4 The Create a Project page

      • 10.8 The Project Details page

        • 10.8.1 Updating the navigation rule

      • 10.9 Adding an error page

        • 10.9.1 Updating web.xml

        • 10.9.2 Updating the navigation rule

      • 10.10 Internationalizing and localizing the UI

        • 10.10.1 Externalizing text into the resource bundle

        • 10.10.2 Internationalizing the header

        • 10.10.3 Localizing for Russian

      • 10.11 Summary

  • Part 3 - Developing application logic

    • The JSF environment

      • 11.1 From servlets to JSF

      • 11.2 The application foundation

        • 11.2.1 Application

        • 11.2.2 Evaluation expressions

      • 11.3 It’s all in the context

        • 11.3.1 FacesContext

        • 11.3.2 FacesMessage

        • 11.3.3 ExternalContext

      • 11.4 Event handling

        • 11.4.1 FacesEvent

        • 11.4.2 Handling action events

        • 11.4.3 Handling value-change events

        • 11.4.4 Handling phase events

      • 11.5 Components revisited

        • 11.5.1 UIComponent

        • 11.5.2 UIViewRoot

        • 11.5.3 ValueHolder

        • 11.5.4 EditableValueHolder

        • 11.5.5 SelectItem and SelectItemGroup model beans

      • 11.6 Summary

    • Building an application: design issues and foundation classes

      • 12.1 Layers of the pie

      • 12.2 Roasting the beans

        • 12.2.1 The importance of toString

        • 12.2.2 Serialization for breakfast

        • 12.2.3 It’s all in the properties

        • 12.2.4 Exposing beans

      • 12.3 Exploring the business layer and data layers

      • 12.4 Developing the application layer

        • 12.4.1 Handling constants

        • 12.4.2 Organizing utility methods

        • 12.4.3 Initializing singletons

        • 12.4.4 Adapting business objects

      • 12.5 Writing a visit object for session state

      • 12.6 Developing a base backing bean class

      • 12.7 Summary

    • Building an application: backing beans, security, and internationalization

      • 13.1 Writing backing beans

        • 13.1.1 Thread safety

        • 13.1.2 Handling errors

        • 13.1.3 Performing authentication

        • 13.1.4 Listing projects with UIData and parameterizing listeners

        • 13.1.5 Updating projects

        • 13.1.6 Creating new projects

        • 13.1.7 Paging through the project history with UIData

        • 13.1.8 Working with JDBC ResultSets and UIData

      • 13.2 Adding security

        • 13.2.1 Container-based vs. custom security

        • 13.2.2 Using custom security

      • 13.3 Supporting internationalization in code

        • 13.3.1 Internationalizing text with resource bundles

        • 13.3.2 Internationalizing messages

      • 13.4 Design consequences and alternatives

        • 13.4.1 Accessing the business layer

        • 13.4.2 Organizing beans by function

        • 13.4.3 Action methods implemented by backing beans

        • 13.4.4 Initializing backing bean properties with the Managed Bean Creation facility

      • 13.5 Summary

    • Integrating JSF with Struts and existing applications

      • 14.1 What integration means

      • 14.2 When to use JSF with other frameworks

      • 14.3 The many faces of requests and responses

      • 14.4 Integrating JSF with Struts applications

        • 14.4.1 First steps

        • 14.4.2 Migrating Struts JSP tags

        • 14.4.3 Using JSF action methods and managed beans

        • 14.4.4 Who’s controlling whom?

      • 14.5 Integrating JSF with non-Struts applications

      • 14.6 Summary

  • Part 4 - Writing custom components, renderers, validators, and converters

    • The JSF environment: a component developer’s perspective

      • 15.1 Three steps to UI extension nirvana

      • 15.2 Developing UI components

        • 15.2.1 Deciding when to write a UI component

        • 15.2.2 Classes and interfaces

        • 15.2.3 Event handling with method bindings

        • 15.2.4 Registration

        • 15.2.5 JSP integration

      • 15.3 Developing renderers

        • 15.3.1 Deciding when to write a renderer

        • 15.3.2 Renderer

        • 15.3.3 RenderKit

        • 15.3.4 Registration

        • 15.3.5 JSP integration

      • 15.4 Developing validators

        • 15.4.1 Validator

        • 15.4.2 Registration

        • 15.4.3 JSP integration

      • 15.5 Developing converters

        • 15.5.1 Converter

        • 15.5.2 Registration

        • 15.5.3 JSP integration

      • 15.6 Handling internationalization

      • 15.7 Packaging UI extensions

      • 15.8 Summary

    • Using JSF without JSP

      • A.1 How JSF handles display technologies

      • A.2 Creating views with class-based pages

      • A.3 Creating views with XUL

      • A.4 Other options

  • references

  • index

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I

    • J

    • K

    • L

    • M

    • N

    • O

    • P

    • R

    • S

    • T

    • U

    • V

    • W

    • X

  • Part 5 - Writing custom components, renderers, validators, and converters: examples

    • UIInputDate: a simple input component

      • 16.1 Writing the UIInputDate class

        • 16.1.1 Encoding

        • 16.1.2 Decoding

        • 16.1.3 Implementing StateHolder methods

      • 16.2 Registering the component

      • 16.3 JSP integration

        • 16.3.1 Writing the JSP custom tag

        • 16.3.2 Validating the tag

        • 16.3.3 Adding the tag to the tag library

      • 16.4 Using the component

      • 16.5 Summary

    • RolloverButton renderer: a renderer with JavaScript support

      • 17.1 Writing the RolloverButtonRenderer class

        • 17.1.1 Encoding

        • 17.1.2 Decoding

        • 17.1.3 Registering the renderer

      • 17.2 JSP Integration

        • 17.2.1 Writing the HtmlBaseTag class

        • 17.2.2 Writing the JSP custom tag

        • 17.2.3 Validating the tag

        • 17.2.4 Adding the tag to the tag library

      • 17.3 Using the renderer

      • 17.4 Wrapping an existing renderer

        • 17.4.1 Developing the RolloverButtonDecoratorRenderer class

      • 17.5 Summary

    • UIHeadlineViewer: a composite, data-aware component

      • 18.1 RSS and the Informa API

      • 18.2 Using UIData with Informa

      • 18.3 Subclassing DataModel

      • 18.4 Writing the UIHeadlineViewer class

      • 18.5 Registering the component

      • 18.6 JSP integration

        • 18.6.1 Writing the JSP custom tag

        • 18.6.2 Adding the tag to the tag library

      • 18.7 Using the component

      • 18.8 Summary

    • UINavigator: a model-driven toolbar component

      • 19.1 Writing the model classes

      • 19.2 Writing the UINavigator class

        • 19.2.1 Implementing ActionSource methods

        • 19.2.2 Overriding UIComponentBase methods

        • 19.2.3 Implementing StateHolder methods

        • 19.2.4 Developing NavigatorActionListener: a custom ActionListener

      • 19.3 Registering the component

      • 19.4 Writing the ToolbarRenderer class

        • 19.4.1 Encoding

        • 19.4.2 Decoding

      • 19.5 Registering the renderer

      • 19.6 JSP integration

        • 19.6.1 Writing the Navigator_ToolbarTag component tag

        • 19.6.2 Writing the NavigatorItemTag tag handler

        • 19.6.3 Adding the tags to the tag library

      • 19.7 Using the component

      • 19.8 Summary

    • Validator and converter examples

      • 20.1 Validator methods vs. validator classes

      • 20.2 Developing a validator

        • 20.2.1 Writing the RegularExpressionValidator class

        • 20.2.2 Registering the validator

        • 20.2.3 Integrating with JSP

        • 20.2.4 Using the validator

      • 20.3 When custom converters are necessary

      • 20.4 Developing a converter

        • 20.4.1 Writing the UserConverter class

        • 20.4.2 Registering the converter

        • 20.4.3 JSP integration

        • 20.4.4 Using the converter

      • 20.5 Summary

    • A survey of JSF IDEs and implementations

      • B.1 Using JSF with Oracle JDeveloper

        • B.1.1 Oracle’s view on JSF

        • B.1.2 What are ADF Faces Components?

        • B.1.3 Exploring JDeveloper

        • B.1.4 Building ProjectTrack’s Login page

        • B.1.5 Wrapping up

      • B.2 Using JSF with WebSphere Studio

        • B.2.1 Exploring WebSphere Studio

        • B.2.2 Building ProjectTrack’s Login page

        • B.2.3 Wrapping up

      • B.3 JSF and Java Studio Creator

        • B.3.1 Using Java Studio Creator

        • B.3.2 Building ProjectTrack’s Login page

        • B.3.3 Wrapping up

      • B.4 JSF implementations

    • Extending the core JSF classes

      • C.1 The classes behind the scenes

      • C.2 Replacing or extending the pluggable classes

        • C.2.1 Configuring a pluggable class

        • C.2.2 Decorating a pluggable class

        • C.2.3 Replacing a pluggable class

    • JSF configuration

      • D.1 Common attributes

      • D.2 Common elements

        • D.2.1 <icon>

        • D.2.2 <property>

        • D.2.3 <attribute>

        • D.2.4 <facet>

      • D.3 Everyday configuration and pluggable classes

        • D.3.1 <application>

        • D.3.2 <managed-bean>

        • D.3.3 <referenced-bean>

        • D.3.4 <navigation-rule>

      • D.4 User interface extensions

        • D.4.1 <component>

        • D.4.2 <render-kit>

        • D.4.3 <validator>

        • D.4.4 <converter>

      • D.5 Advanced features

        • D.5.1 <lifecycle>

        • D.5.2 <factory>

    • Time zone, country, language, and currency codes

      • E.1 Time zone codes

      • E.2 Language codes

      • E.3 Country codes

      • E.4 Currency codes

  • references

  • index

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I

    • J

    • K

    • L

    • M

    • N

    • O

    • P

    • R

    • S

    • T

    • U

    • V

    • W

    • X

Nội dung

Kito D. Mann Foreword by Ed Burns MANNING J AVA S ERVER FACES INACTION www.it-ebooks.info www.it-ebooks.info JavaServer Faces in Action KITO D. MANN MANNING Greenwich (74° w. long.) Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info For online information and ordering of this and other Manning books, please go to www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. 209 Bruce Park Avenue Fax: (203) 661-9018 Greenwich, CT 06830 email: orders@manning.com ©2005 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books they publish printed on acid-free paper, and we exert our best efforts to that end. All screens shots of Oracle JDeveloper in appendix B are reproduced with the permission of Oracle Corp. Copyright Oracle Corp, 2004. All screens shots of WebSphere Studio in appendix B are reproduced with the permission of IBM Corp. Copyright IBM Corp, 2004. Manning Publications Co. Copyeditor: Liz Welch 209 Bruce Park Avenue Typesetter: Denis Dalinnik Greenwich, CT 06830 Cover designer: Leslie Haimes ISBN 1-932394-11-7 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – VHG – 08 07 06 05 04 Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info To my beautiful wife and best friend, Tracey. This book would not exist without you, and I’m eternally grateful for the positive influence you’ve had on my life, always pushing me to be the best I can be. Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info vii PART 1 EXPLORING JAVASERVER FACES 1 1 ■ Introducing JavaServer Faces 3 2 ■ JSF fundamentals 38 3 ■ Warming up: getting around JSF 88 4 ■ Getting started with the standard components 137 5 ■ Using the input and data table components 185 6 ■ Internationalization, validators, and converters 234 PART 2 BUILDING USER INTERFACES 275 7 ■ Introducing ProjectTrack 277 8 ■ Developing a user interface without Java code: the Login page 287 9 ■ Developing a user interface without Java code: the other pages 316 10 ■ Integrating application functionality 354 brief contents Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info viii BRIEF CONTENTS PART 3 DEVELOPING APPLICATION LOGIC 407 11 ■ The JSF environment 409 12 ■ Building an application: design issues and foundation classes 456 13 ■ Building an application: backing beans, security, and internationalization 499 14 ■ Integrating JSF with Struts and existing applications 568 PART 4 WRITING CUSTOM COMPONENTS, RENDERERS, VALIDATORS, AND CONVERTERS 603 15 ■ The JSF environment: a component developer’s perspective 605 PART 5 WRITING CUSTOM COMPONENTS, RENDERERS, VALIDATORS, AND CONVERTERS: EXAMPLES 703 16 ■ UIInputDate: a simple input component 705 17 ■ RolloverButton renderer: a renderer with JavaScript support 727 18 ■ UIHeadlineViewer: a composite, data-aware component 756 19 ■ UINavigator: a model-driven toolbar component 794 20 ■ Validator and converter examples 839 ONLINE EXTENSION The five chapters in part 5 (plus four additional appendixes) are not included in the print edition. They are available for download in PDF format from the book’s web page to owners of this book. For free access to the online extension please go to www. manning.com/mann. Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info ix foreword xxi preface xxiii acknowledgments xxv about this book xxvii about the title and cover xxxiii PART 1 EXPLORING JAVASERVER FACES 1 1 Introducing JavaServer Faces 3 1.1 It’s a RAD-ical world 4 So, what is JavaServer Faces? 5 Industry support 10 1.2 The technology under the hood 10 Hypertext Transfer Protocol (HTTP) 11 Servlets 12 Portlets 13 JavaBeans 14 JSP and other display technologies 15 1.3 Frameworks, frameworks, frameworks 16 Why do we need frameworks? 16 She’s a Model 2 17 JSF, Struts, and other frameworks 18 1.4 Components everywhere 19 contents Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info x CONTENTS 1.5 Hello, world! 22 Dissecting hello.jsp 24 Dissecting goodbye.jsp 31 Examining the HelloBean class 32 Configuration with faces-config.xml 34 Configuration with web.xml 36 1.6 Summary 37 2 JSF fundamentals 38 2.1 The key pieces of the pie 39 User interface components 41 Renderers 43 Validators 44 Backing beans 45 Converters 48 Events and listeners 49 Messages 55 Navigation 56 2.2 The Request Processing Lifecycle 57 Phase 1: Restore View 61 Phase 2: Apply Request Values 63 Phase 3: Process Validations 65 Phase 4: Update Model Values 66 Phase 5: Invoke Application 66 Phase 6: Render Response 68 2.3 Understanding component and client identifiers 69 Naming containers 72 Referencing identifiers 73 2.4 Exploring the JSF expression language 76 Understanding scoped variables 80 Using implicit variables 81 Using the EL with components 83 2.5 Summary 86 3 Warming up: getting around JSF 88 3.1 Setting up your JSF environment 89 Basic requirements 89 Choosing a JSF implementation 89 Directory structure 90 Configuration 92 3.2 The role of JSP 102 Using JSP includes 103 Using JSF with JSTL and other JSP custom tags 104 3.3 Creating and initializing beans 110 Declaring managed beans 113 Declaring Lists and Maps as managed beans 123 Setting values with value-binding expressions 125 3.4 Navigating the sea of pages 129 3.5 Summary 136 Licensed to JOSE CARLOS ROMERO FIGUEROA <jose.romero@galicia.seresco.es> www.it-ebooks.info [...]... Sun to paint a picture of how JSF is integrated into different IDEs In addition, this text was influenced by my role as editor -in- chief of JSF Central, where I have gained a unique vantage point of the growing JSF ecosystem So, there you have it I hope JavaServer Faces in Action will inspire in you the enthusiasm that I have for this technology and serve as a useful tool in your own projects In the meantime,... CONTENTS xiii PART 2 BUILDING USER INTERFACES 275 7 Introducing ProjectTrack 277 Requirements 7.2 The conceptual model 7.3 User interface 7.4 Development team 284 7.5 8 7.1 Summary 278 281 283 286 Developing a user interface without Java code: the Login page 287 8.1 Getting started 289 Setting up web.xml 8.2 289 ■ Creating the Login page Setting up faces- config.xml 290 291 Starting with HtmlGraphicImage... the In Action books are designed to help learning and remembering According to research in cognitive science, the things people remember are things they discover during self-motivated exploration Although no-one at Manning is a cognitive scientist, we are convinced that for learning to become permanent it must pass through stages of exploration, play, and, interestingly, re-telling of what is being... of the pie 12.2 Roasting the beans 457 460 The importance of toString 461 Serialization for breakfast 462 It’s all in the properties 462 Exposing beans 472 ■ ■ 12.3 Exploring the business layer and data layers 12.4 Developing the application layer 476 473 Handling constants 478 Organizing utility methods 480 Initializing singletons 482 Adapting business objects 484 ■ ■ 12.5 Writing a visit object for... JavaServerTM Faces technology in their products While developing the presentation, I am learning some things about the work we’ve been doing on JavaServer Faces for the past three years The vendors have their own set of concerns unique to adapting their product for JavaServer Faces, but they all voice one opinion loud and clear: they are very relieved to finally have a standard for web-based user interfaces... Executing application commands 219 Declaring buttons with HtmlCommandButton 219 Creating an action link with HtmlCommandLink 221 5.10 5.11 6 Displaying data sets with HtmlDataTable Summary 223 233 Internationalization, validators, and converters 234 6.1 Internationalization and localization 235 Looking into locales 236 Creating resource bundles Using resource bundles with components 241 Internationalizing... 292 Adding a form 295 ■ 8.3 Sprucing things up 300 Using an image for the button 301 Integrating with JavaScript 301 Adding Cascading Style Sheets 303 ■ ■ 8.4 Adding validators 304 Customizing validation messages 307 8.5 8.6 9 Improving layout with HtmlPanelGrid Summary 308 314 Developing a user interface without Java code: the other pages 316 9.1 Building the header with a custom component 317 Using... out, knowing the specification in detail is still helpful in order to use it As a member of the expert group developing the next version of JavaServer Pages, Kito is no stranger to technology standards Kito grasps the key value-adds of JavaServer Faces and has explained them in a book that is accessible and indepth You will see what sets JavaServer Faces apart from other web UI frameworks, including its... Accessing the business layer 562 Organizing beans by function 563 Action methods implemented by backing beans 564 Initializing backing bean properties with the Managed Bean Creation facility 565 ■ ■ ■ 13.5 14 Summary 566 Integrating JSF with Struts and existing applications 568 14.1 What integration means 14.2 When to use JSF with other frameworks 14.3 The many faces of requests and responses 571 14.4 Integrating... parameterizing listeners 511 Updating projects 522 Creating new projects 528 Paging through the project history with UIData 534 Working with JDBC ResultSets and UIData 540 ■ ■ ■ ■ ■ ■ 13.2 Adding security 545 Container-based vs custom security Using custom security 547 13.3 546 Supporting internationalization in code 551 Internationalizing text with resource bundles Internationalizing messages 557 13.4 Design . Kito D. Mann Foreword by Ed Burns MANNING J AVA S ERVER FACES INACTION www.it-ebooks.info www.it-ebooks.info JavaServer Faces in Action KITO D. MANN MANNING Greenwich (74° w. long.) Licensed. converters 234 PART 2 BUILDING USER INTERFACES 275 7 ■ Introducing ProjectTrack 277 8 ■ Developing a user interface without Java code: the Login page 287 9 ■ Developing a user interface without Java. title and cover xxxiii PART 1 EXPLORING JAVASERVER FACES 1 1 Introducing JavaServer Faces 3 1.1 It’s a RAD-ical world 4 So, what is JavaServer Faces? 5 ■ Industry support 10 1.2 The technology

Ngày đăng: 05/05/2014, 14:29

TỪ KHÓA LIÊN QUAN