Manning seam in action jun 2008 ISBN 1933988401 pdf

625 53 0
Manning seam in action jun 2008 ISBN 1933988401 pdf

Đ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

Seam in Action Seam in Action DAN ALLEN MANNING Greenwich (74° w long.) To my wife Sarah, without whom this book would not have been possible Thanks for giving up everything I love you forever For online information and ordering of this and other Manning books, please visit 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 Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: orders@manning.com ©2009 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 we publish printed on acid-free paper, and we exert our best efforts to that end Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine Manning Publications Co Sound View Court 3B Greenwich, CT 06830 Development Editor: Copyeditor: Typesetter: Cover designer: Proofreader: ISBN 1933988401 Printed in the United States of America 10 – MAL – 13 12 11 10 09 08 Cynthia Kane Liz Welch Gordan Salinovic Leslie Haimes Katie Tennant brief contents PART PART PART TEEING OFF WITH SEAM .1 ■ Seam unifies Java EE ■ Putting seam-gen to work 29 SEAM FUNDAMENTALS 81 ■ The Seam life cycle 83 ■ Components and contexts ■ The Seam component descriptor 179 ■ Absolute inversion of control 130 219 SEAM’S STATE MANAGEMENT 271 ■ The conversation: Seam’s unit of work 273 ■ Understanding Java persistence 325 ■ Seam-managed persistence and transactions 10 ■ Rapid Seam development v 380 352 PART SINKING THE BUSINESS REQUIREMENTS .431 11 ■ Securing Seam applications 433 12 ■ Ajax and JavaScript remoting 475 13 ■ File, rich rendering, and email support 511 contents foreword xvii preface xix acknowledgments xxi about this book xxiv about the cover illustration xxxiv PART 1 TEEING OFF WITH SEAM Seam unifies Java EE 1.1 Which framework should I use? Choosing Seam A complete application stack Why Seam was created Debunking the “vendor lock-in” myth Making the case for Seam ■ ■ ■ 1.2 Seam’s approach to unification Seam integrates JSF, JPA, and POJO components The contextual component model 11 1.3 Your first swings with Seam 14 Entity classes serving as backing beans 14 An all-in-one component 15 Binding components to the view 17 Retrieving data on demand 19 Clickable lists 19 Integration tests designed for JSF 20 ■ ■ ■ ■ ■ vii viii CONTENTS 1.4 Seam’s core competencies 22 Turns JSF into a pro 22 Gets you rich quick an agile environment 26 25 ■ 1.5 Summary ■ Fosters 27 Putting seam-gen to work 29 2.1 The Open 18 prototype 30 Consider yourself tasked 30 schema 31 2.2 Mapping entities to the database Letting seam-gen the initial work seam-gen’s specialty 2.3 ■ 35 ■ 34 Features that seam-gen provides 36 Kick off your project with seam-gen 37 A look at the seam-gen commands 38 A Q&A session with seamgen 40 Creating a basic project structure 43 Generating the CRUD 44 ■ ■ 2.4 ■ Deploying the project to JBoss AS 46 To deploy… 46 …or to explode 48 Switching between environments 49 Launching JBoss AS 50 ■ ■ ■ 2.5 Show and tell, change, and repeat 51 Walking the course 52 Guiding the reverse-engineering process 58 Exploring the structure of the generated project ■ ■ 2.6 Rapidly developing a seam-gen project Incremental hot deployment by using an IDE 70 2.7 PART Summary 65 ■ 61 65 Accelerating development 79 SEAM FUNDAMENTALS 81 The Seam life cycle 3.1 83 Exploring how Seam participates in a request 84 Flipping Seam’s switch 85 The JSF servlet, the workhorse of Seam 85 Serving collateral resources via the Seam resource servlet 91 Seam’s chain of servlet filters 92 The Seam phase listener 95 ■ ■ ■ 3.2 ■ The JSF life cycle sans Seam 96 The JSF life-cycle phases 97 The initial request 98 The postback 100 Shortcomings of the JSF life cycle 101 ■ ■ ■ ix CONTENTS 3.3 Seam’s page-oriented life-cycle additives 103 Advanced orchestration with pages.xml 104 Intelligent navigation 105 Seam UI command components 109 parameters 110 Page actions: execute me first! 114 ■ ■ ■ Page ■ 3.4 Combining page actions with navigation 116 Sanity checking a request 117 Built-in page actions 118 Search engine–friendly URLs 120 ■ ■ 3.5 The JSF life cycle with Seam 122 Phase listeners versus servlet filters 122 augmented life cycle 122 3.6 ■ Stepping through the A try-catch block around the life cycle 126 Failing gracefully or with intentional crudeness 126 Registering an exception handler 126 Handling the exception at the source 127 ■ ■ 3.7 Summary 129 Components and contexts 130 4.1 Seam’s contextual naming container 131 Seam’s context model 131 Unifying the Java servlet contexts 132 Seam’s new stateful contexts 133 Seam’s enhanced servlet contexts 134 ■ ■ 4.2 ■ Sorting out components 135 Components vs component instances components 137 4.3 ■ Defining components using annotations Giving a component a @Name 139 in @Scope 140 4.4 135 ■ Seam manages 138 Putting a component A comprehensive component example 141 Creating the entity components 141 Preparing an action bean component 145 Integration testing components 146 Hooking components into JSF 148 ■ ■ ■ 4.5 A component’s life 150 Loading component definitions 151 When to @Install a component 152 Giving a component multiple @Roles 155 Instantiating components at @Startup 156 Component life-cycle callbacks 157 Wiring components together 159 Where all components go to die 161 ■ ■ ■ ■ ■ ... (www .manning. com/SeaminAction), you can check out Seam s business process management solution in chapter 14 and Seam s Spring integration in chapter 15 Appendix A shows you how to set up Seam. .. handling the book’s web presence on manning. com; and Steven Hong for continued support in publicizing the book and preparing marketing materials ACKNOW LEDGM ENTS xxiii Join me in thanking Gavin... holding in your hands is that it doesn’t blindly toe the Seam party line Dan Allen has painstakingly broken Seam down to its core concepts and reassembled them in a way that is fresh and unique Seam

Ngày đăng: 19/04/2019, 15:49

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan