The Java EE 6 Tutorial: Basic Concepts, Vol. 1

Paperback
from $0.00

Author: Eric Jendrock

ISBN-10: 0137081855

ISBN-13: 9780137081851

Category: API & Controls

Search in google:

The Java EE 6 Tutorial: Basic Concepts, Fourth Edition, is a task-oriented, example-driven guide to developing enterprise applications for the Java Platform, Enterprise Edition 6 (Java EE 6). Written by members of the Java EE 6 documentation team at Oracle, this book provides new and intermediate Java programmers with a deep understanding of the platform.Starting with expert guidance on web tier technologies, including JavaServer Faces and Facelets, this book also covers building web services using JAX-WS and JAX-RS, developing business logic with Enterprise JavaBeans components, accessing databases using the Java Persistence API, securing web and enterprise applications, and using Contexts and Dependency Injection for the Java EE platform.This edition contains extensive new material throughout, including detailed introductions to the latest APIs and platform features, and instructions for using the latest versions of GlassFish Server Open Source Edition and NetBeans IDE. Key platform features covered includeConvention over configuration, so developers need specify only those aspects of an application that vary from the convention Annotated POJOs (Plain Old Java Objects) with optionalSimplified but more flexible packaging Lightweight Web Profile that is ideal for developing web applicationsThe Java Series…from the SourceSince 1996, when Addison-Wesley published the first edition of The Java Programming Language by Ken Arnold and James Gosling, this series has been the place to go for complete, expert, and definitive information on Java technology. The books in this series provide the detailed information developers need to build effective, robust, and portable applications and are an indispensable resource for anyone using the Java platform.

Preface xxiPart I: Introduction 1Chapter 1: Overview 3Java EE 6 Platform Highlights 4Java EE Application Model 5Distributed Multitiered Applications 6Java EE Containers 13Web Services Support 15Java EE Application Assembly and Deployment 17Packaging Applications 17Development Roles 19Java EE 6 APIs 22Java EE 6 APIs in the Java Platform, Standard Edition 6.0 31GlassFish Server Tools 34Chapter 2: Using the Tutorial Examples 37Required Software 37Starting and Stopping the GlassFish Server 41Starting the Administration Console 42Starting and Stopping the Java DB Server 43Building the Examples 44Tutorial Example Directory Structure 44Getting the Latest Updates to the Tutorial 44Debugging Java EE Applications 45Part II: The Web Tier 47Chapter 3: Getting Started with Web Applications 49Web Applications 50Web Application Lifecycle 51Web Modules: The hello1 Example 53Configuring Web Applications: The hello2 Example 62Further Information about Web Applications 71Chapter 4: JavaServer Faces Technology 73What Is a JavaServer Faces Application? 74JavaServer Faces Technology Benefits 75Creating a Simple JavaServer Faces Application 77Further Information about JavaServer Faces Technology 81Chapter 5: Introduction to Facelets 83What Is Facelets? 83Developing a Simple Facelets Application 85Templating 91Composite Components 94Resources 96Chapter 6: Expression Language 99Overview of the EL 99Immediate and Deferred Evaluation Syntax 100Value and Method Expressions 102Defining a Tag Attribute Type 108Literal Expressions 109Operators 111Reserved Words 111Examples of EL Expressions 112Chapter 7: Using JavaServer Faces Technology in Web Pages 113Setting Up a Page 113Adding Components to a Page Using HTML Tags 114Using Core Tags 143Chapter 8: Using Converters, Listeners, and Validators 145Using the Standard Converters 145Registering Listeners on Components 151Using the Standard Validators 152Referencing a Backing Bean Method 154Chapter 9: Developing with JavaServer Faces Technology 159Backing Beans 159Writing Bean Properties 162Writing Backing Bean Methods 170Using Bean Validation 174Chapter 10: Java Servlet Technology 179What Is a Servlet? 180Servlet Lifecycle 180Sharing Information 182Creating and Initializing a Servlet 183Writing Service Methods 184Filtering Requests and Responses 187Invoking Other Web Resources 191Accessing the Web Context 193Maintaining Client State 193Finalizing a Servlet 195The mood Example Application 198Further Information about Java Servlet Technology 200Part III: Web Services 201Chapter 11: Introduction to Web Services 203What Are Web Services? 203Types of Web Services 203Deciding Which Type of Web Service to Use 206Chapter 12: Building Web Services with JAX-WS 207Creating a Simple Web Service and Clients with JAX-WS 208Types Supported by JAX-WS 217Web Services Interoperability and JAX-WS 217Further Information about JAX-WS 217Chapter 13: Building RESTful Web Services with JAX-RS 219What Are RESTful Web Services? 219Creating a RESTful Root Resource Class 220Example Applications for JAX-RS 235Further Information about JAX-RS 240Part IV: Enterprise Beans 243Chapter 14: Enterprise Beans 245What Is an Enterprise Bean? 245What Is a Session Bean? 247What Is a Message-Driven Bean? 249Accessing Enterprise Beans 251The Contents of an Enterprise Bean 258Naming Conventions for Enterprise Beans 260The Lifecycles of Enterprise Beans 261Further Information about Enterprise Beans 264Chapter 15: Getting Started with Enterprise Beans 265Creating the Enterprise Bean 265Modifying the Java EE Application 269Chapter 16: Running the Enterprise Bean Examples 271The cart Example 271A Singleton Session Bean Example: counter 278A Web Service Example: helloservice 286Using the Timer Service 290Handling Exceptions 300Part V: Contexts and Dependency Injection for the Java EE Platform 303Chapter 17: Introduction to Contexts and Dependency Injection for the Java EE Platform 305Overview of CDI 306About Beans 307About Managed Beans 307Beans as Injectable Objects 308Using Qualifiers 309Injecting Beans 310Using Scopes 310Giving Beans EL Names 312Adding Setter and Getter Methods 312Using a Managed Bean in a Facelets Page 313Injecting Objects by Using Producer Methods 314Configuring a CDI Application 315Further Information about CDI 315Chapter 18: Running the Basic Contexts and Dependency Injection Examples 317The simplegreeting CDI Example 317The guessnumber CDI Example 322Part VI: Persistence 331Chapter 19: Introduction to the Java Persistence API 333Entities 333Entity Inheritance 345Managing Entities 349Querying Entities 355Further Information about Persistence 355Chapter 20: Running the Persistence Examples 357The order Application 357The roster Application 369The address-book Application 376Chapter 21: The Java Persistence Query Language 381Query Language Terminology 382Creating Queries Using the Java Persistence Query Language 382Simplified Query Language Syntax 384Example Queries 385Full Query Language Syntax 390Chapter 22: Using the Criteria API to Create Queries 415Overview of the Criteria and Metamodel APIs 415Using the Metamodel API to Model Entity Classes 417Using the Criteria API and Metamodel API to Create Basic Typesafe Queries 418Part VII: Security 427Chapter 23: Introduction to Security in the Java EE Platform 429Overview of Java EE Security 430Security Mechanisms 435Securing Containers 439Securing the GlassFish Server 440Working with Realms, Users, Groups, and Roles 441Establishing a Secure Connection Using SSL 449Further Information about Security 454Chapter 24: Getting Started Securing Web Applications 455Overview of Web Application Security 455Securing Web Applications 457Using Programmatic Security with Web Applications 469Examples: Securing Web Applications 474Chapter 25: Getting Started Securing Enterprise Applications 485Securing Enterprise Beans 486Examples: Securing Enterprise Beans 496Securing Application Clients 504Securing Enterprise Information Systems Applications 506Part VIII: Java EE Supporting Technologies 511Chapter 26: Introduction to Java EE Supporting Technologies 513Transactions 513Resources 514Chapter 27: Transactions 517What Is a Transaction? 517Container-Managed Transactions 518Bean-Managed Transactions 524Transaction Timeouts 525Updating Multiple Databases 526Transactions in Web Components 528Further Information about Transactions 528Chapter 28: Resource Connections 529Resources and JNDI Naming 529DataSource Objects and Connection Pools 530Resource Injection 531Resource Adapters and Contracts 534Metadata Annotations 538Common Client Interface 540Further Information about Resources 541Index 543