Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications pptx

210 639 0
Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications pptx

Đ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

www.it-ebooks.info www.it-ebooks.info Java EE 6 Pocket Guide Arun Gupta Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo www.it-ebooks.info Java EE 6 Pocket Guide by Arun Gupta Copyright © 2012 Arun Gupta. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promo- tional use. Online editions are also available for most titles (http://my.safari booksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. Editors: Mike Loukides and Meghan Blanchette Copyeditor: Emily Quill Production Editor: Kristen Borg Proofreader: Kiel Van Horn Indexer: Lucie Haskins Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Rebecca Demarest September 2012: First Edition. Revision History for the First Edition: 2012-09-10 First release See http://oreilly.com/catalog/errata.csp?isbn=9781449336684 for release de- tails. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Java EE 6 Pocket Guide, the image of a jellyfish (Favonia octonema), and related trade dress are trade- marks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. ISBN: 978-1-449-33668-4 [M] 1347298110 www.it-ebooks.info To Menka, my lovely wife and best friend. Your support and encour- agement make our lives fun and meaningful. To Aditya and Mihir, my two joyful boys, for playing with me and keeping me charged. www.it-ebooks.info www.it-ebooks.info Contents Preface ix Chapter 1: Java Platform, Enterprise Edition 1 Introduction 1 Deliverables 4 What’s New in Java EE 6 8 Chapter 2: Managed Beans 13 Define and Use a Managed Bean 14 Lifecycle Callback 15 Chapter 3: Servlets 17 Servlets 17 Servlet Filters 23 Event Listeners 25 Asynchronous Support 29 Web Fragments 31 Security 33 Resource Packaging 35 Error Mapping 37 Handling Multipart Requests 37 v www.it-ebooks.info Chapter 4: Java Persistence API 39 Entities 40 Persistence Unit, Persistence Context, and Entity Manager 43 Create, Read, Update, and Delete Entities 46 Validating the Entities 50 Transactions and Locking 52 Caching 54 Chapter 5: Enterprise JavaBeans 57 Stateful Session Beans 58 Stateless Session Beans 60 Singleton Session Beans 62 Message-Driven Beans 64 Portable Global JNDI Names 66 Transactions 67 Asynchronous 70 Timers 71 Embeddable API 76 EJB.Lite 77 Chapter 6: Contexts and Dependency Injection 79 Injection Points 80 Qualifier and Alternative 81 Producer and Disposer 84 Interceptors and Decorators 86 Scopes and Contexts 90 Stereotypes 92 Events 94 Portable Extensions 95 Chapter 7: JavaServer Faces 99 Facelets 100 vi | Table of Contents www.it-ebooks.info Resource Handling 104 Composite Components 105 Ajax 110 HTTP GET 113 Server and Client Extension Points 115 Navigation Rules 118 Chapter 8: SOAP-Based Web Services 121 Web Service Endpoints 123 Provider-Based Dynamic Endpoints 126 Endpoint-Based Endpoints 128 Web Service Client 129 Dispatch-Based Dynamic Client 132 Handlers 134 Chapter 9: RESTful Web Services 137 Simple RESTful Web Services 138 Binding HTTP Methods 140 Multiple Resource Representations 143 Binding Request to a Resource 144 Mapping Exceptions 147 Chapter 10: Java Message Service 149 Sending a Message 152 Quality of Service 155 Receiving a Message Synchronously 156 Receiving a Message Asynchronously 158 Temporary Destinations 159 Chapter 11: Bean Validation 161 Built-in Constraints 162 Defining a Custom Constraint 165 Table of Contents | vii www.it-ebooks.info Validation Groups 169 Integration with JPA 172 Integration with JSF 174 A:  Getting Started with Java EE 6 Development and Deployment 177 B:  Further Reading 179 Index 183 viii | Table of Contents www.it-ebooks.info [...]... Specifications like CDI, JavaServer Faces 2, Java API for RESTful Services, Java Persistence API 2, and Servlets 3 make the Java EE 6 platform more powerful This book will provide an overview of the main technologies included in the platform, and easy-to-understand code samples will be used throughout to demonstrate improvements in Java EE 6 Deliverables The Java EE 6 platform was developed as Java Specification... configuration, and relying heavily on annotations makes the Java EE 6 platform easy to use and, above all, less verbose Lightweight There are 31 component specifications in the Java EE 6 platform, as listed in Appendix EE. 6 of the platform specification These components include Enterprise JavaBeans (EJB), Servlets, JavaServer Faces (JSF), Java API for RESTful Web Services (JAX-RS), and many others... injection, and resource management that span across the platform Each component is defined in a separate specification that also describes the API, javadocs, and expected behavior The Java Platform, Enterprise Edition 6 (Java EE 6) was released in December 2009 and provides a simple, easy-to-use, and complete stack for building such applications The previous version of the platform, Java EE 5, took... Debugging Support for Other Languages • JSR 52: Standard Tag Library for JavaServer Pages (JSTL)1.2 • JSR 245: JavaServer Pages (JSP) 2.2 and Expression Language (EL) 1.2 • JSR 314: JavaServer Faces (JSF) 2.0 • JSR 315: Servlet 3.0 Enterprise Technologies • JSR 250: Common Annotations for the Java Platform 1.1 • JSR 299: Contexts and Dependency Injection (CDI) for the Java EE Platform 1.0 • JSR 303:... 1.0 • JSR 3 16: Managed Beans 1.0 • JSR 317: Java Persistence API (JPA) 2.0 • JSR 318: Enterprise JavaBeans (EJB) 3.1 • JSR 318: Interceptors 1.1 • JSR 322: Java EE Connector Architecture 1 .6 • JSR 330: Dependency Injection for Java 1.0 • JSR 907: Java Transaction API (JTA) 1.1 • JSR 914: Java Message Server (JMS) 1.1 • JSR 919: JavaMail 1.4 Web Service Technologies • JSR 67 : Java APIs for XML Messaging... standards-based platform for developing web and enterprise applications These applications are typically designed as multitier applications, with a frontend tier consisting of web frameworks, a middle tier providing security and transactions, and a backend tier providing connectivity to a database or a legacy system The Java EE platform defines APIs for different components in each tier, and also provides... understand the technology better Thanks to my colleagues at Oracle and the JSR specification leads for explaining the intended use cases of different technologies And thanks to everybody else in my life, who provided much-needed breaks from book writing xii | Preface www.it-ebooks.info CHAPTER 1 Java Platform, Enterprise Edition Introduction The Java Platform, Enterprise Edition (Java EE) provides a standards-based... to declare constraints and validate them across different technologies JAX-RPC (JSR 101), JAXR (JSR 93), EJB Entity Beans (part of JSR 153), and Java EE Application Deployment (JSR 88) are marked for pruning in this version of the platform The RI of Java EE 6 is built in the GlassFish Community The GlassFish Server Open Source Edition provides a full Java EE 6 compliant, free, and open source application... distribution and can be downloaded from Deliverables | 7 www.it-ebooks.info http://oracle.com/goto/glassfish As of this writing, there are 17 Java EE 6 compliant application servers The complete list is available at http://www.oracle.com/technetwork /java/ javaee/ overview/compatibility-jsp-1 369 84.html The TCK is available to all Java EE licensees for testing their respective implementations What’s New in Java EE. .. Messaging (JAXM) 1.3 • JSR 93: Java API for XML Registries (JAXR) 1.0 • JSR 101: Java API for XML-based RPC (JAXRPC) 1.1 • JSR 109: Implementing Enterprise Web Services 1.3 Deliverables | 5 www.it-ebooks.info • JSR 173: Streaming API for XML (StAX) 1.0 • JSR 181: Web Services Metadata for the Java Platform 2.0 • JSR 222: Java Architecture for XML Binding (JAXB) 2.2 • JSR 224: Java API for XML Web Services (JAXWS) . Preface www.it-ebooks.info CHAPTER 1 Java Platform, Enterprise Edition Introduction The Java Platform, Enterprise Edition (Java EE) provides a standards-based platform for developing web and enterprise applications. These applications. javadocs, and expected behavior. The Java Platform, Enterprise Edition 6 (Java EE 6) was re- leased in December 2009 and provides a simple, easy-to-use, and complete stack for building such applications. . platform, and easy-to-understand code samples will be used throughout to demonstrate improvements in Java EE 6. Deliverables The Java EE 6 platform was developed as Java Specification Request 316

Ngày đăng: 29/03/2014, 17:20

Từ khóa liên quan

Mục lục

  • Table of Contents

  • Preface

    • Conventions Used in This Book

    • Using Code Examples

    • Safari® Books Online

    • How to Contact Us

    • Acknowledgments

    • Introduction

    • Deliverables

    • What’s New in Java EE 6

    • Chapter 2. Managed Beans

      • Define and Use a Managed Bean

      • Lifecycle Callback

      • Chapter 3. Servlets

        • Servlets

        • Servlet Filters

        • Event Listeners

        • Asynchronous Support

        • Web Fragments

        • Security

        • Resource Packaging

        • Error Mapping

        • Handling Multipart Requests

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

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

Tài liệu liên quan