Java EE 7 Tutorial, The, Volume 1
Häftad, Engelska, 2014
Av Eric Jendrock, Ricardo Cervera-Navarro, Ian Evans, Kim Haase, William Markito
439 kr
The Java EE 7 Tutorial: Volume 1, Fifth Edition, is a task-oriented, example-driven guide to developing enterprise applications for the Java Platform, Enterprise Edition 7 (Java EE 7). Written by members of the Java EE documentation team at Oracle, this book provides new and intermediate Java programmers with a deep understanding of the platform.
This guide includes descriptions of platform features and provides instructions for using the latest versions of NetBeans IDE and GlassFish Server Open Source Edition. The book introduces platform basics, including resource creation, resource injection, and packaging. It covers JavaServer Faces, Java Servlets, the Java API for WebSocket, the Java API for JSON Processing (JSON-P), internationalization and localization, Bean Validation, Contexts and Dependency Injection for Java EE (CDI), and web services (JAX-WS and JAX-RS).
Produktinformation
- Utgivningsdatum2014-05-29
- Mått190 x 230 x 40 mm
- Vikt1 170 g
- FormatHäftad
- SpråkEngelska
- SerieJava Series
- Antal sidor696
- Upplaga5
- FörlagPearson Education
- ISBN9780321994929
Tillhör följande kategorier
Eric Jendrock leads the Java EE Tutorial team at Oracle and documented Java Servlet technology as well as internationalization and localization.Ricardo Cervera-Navarro documented resource injection, WebSocket, JSON-P, and JAX-RS, and contributed Java Servlet examples.Ian Evans documented Bean Validation, JAX-RS, and JAX-WS.Kim Haase documented JavaServer Faces technology and CDI.William Markito, a former member of the Platform Technology Solutions group at Oracle, created examples for several technologies.
- Preface xxixPart I: Introduction 1Chapter 1: Overview 31.1 Java EE 7 Platform Highlights 41.2 Java EE Application Model 51.3 Distributed Multitiered Applications 61.4 Java EE Containers 131.5 Web Services Support 151.6 Java EE Application Assembly and Deployment 171.7 Development Roles 171.8 Java EE 7 APIs 201.9 Java EE 7 APIs in the Java Platform, Standard Edition 7 301.10 GlassFish Server Tools 33Chapter 2: Using the Tutorial Examples 352.1 Required Software 352.2 Starting and Stopping GlassFish Server 392.3 Starting the Administration Console. 402.4 Starting and Stopping the Java DB Server 402.5 Building the Examples 412.6 Tutorial Example Directory Structure 412.7 Java EE 7 Maven Archetypes in the Tutorial 422.8 Getting the Latest Updates to the Tutorial 432.9 Debugging Java EE Applications 44Part II: Platform Basics 47Chapter 3: Resource Creation 493.1 Resources and JNDI Naming 493.2 DataSource Objects and Connection Pools 503.3 Creating Resources Administratively 51Chapter 4: Injection 534.1 Resource Injection 534.2 Dependency Injection 544.3 The Main Differences between Resource Injection and Dependency Injection 55Chapter 5: Packaging 575.1 Packaging Applications 575.2 Packaging Enterprise Beans 595.3 Packaging Web Archives 615.4 Packaging Resource Adapter Archives 63Part III: The Web Tier 65Chapter 6: Getting Started with Web Applications 676.1 Web Applications 686.2 Web Application Lifecycle 696.3 A Web Module That Uses JavaServer Faces Technology: The hello1 Example 706.4 A Web Module That Uses Java Servlet Technology: The hello2 Example 776.5 Configuring Web Applications 816.6 Further Information about Web Applications 86Chapter 7: JavaServer Faces Technology 877.1 What Is a JavaServer Faces Application? 887.2 JavaServer Faces Technology Benefits 897.3 A Simple JavaServer Faces Application 917.4 User Interface Component Model 927.5 Navigation Model 1007.6 The Lifecycle of a JavaServer Faces Application 1037.7 Partial Processing and Partial Rendering 1107.8 Further Information about JavaServer Faces Technology 110Chapter 8: Introduction to Facelets 1118.1 What Is Facelets? 1128.2 The Lifecycle of a Facelets Application 1148.3 Developing a Simple Facelets Application: The guessnumber-jsf Example Application 1158.4 Using Facelets Templates 1218.5 Composite Components 1248.6 Web Resources 1278.7 Relocatable Resources 1288.8 Resource Library Contracts 1288.9 HTML5-Friendly Markup 132Chapter 9: Expression Language 1419.1 Overview of the EL 1419.2 Immediate and Deferred Evaluation Syntax 1429.3 Value and Method Expressions 1449.4 Operations on Collection Objects 1519.5 Operators 1539.6 Reserved Words 1549.7 Examples of EL Expressions 1549.8 Further Information about the Expression Language 155Chapter 10: Using JavaServer Faces Technology in Web Pages 15710.1 Setting Up a Page 15810.2 Adding Components to a Page Using HTML Tag Library Tags 15910.3 Using Core Tags 192Chapter 11: Using Converters, Listeners, and Validators 19711.1 Using the Standard Converters 19811.2 Registering Listeners on Components 20311.3 Using the Standard Validators 20711.4 Referencing a Managed Bean Method 209Chapter 12: Developing with JavaServer Faces Technology 21312.1 Managed Beans in JavaServer Faces Technology 21312.2 Writing Bean Properties 21612.3 Writing Managed Bean Methods 226Chapter 13: Using Ajax with JavaServer Faces Technology 23113.1 Overview of Ajax 23213.2 Using Ajax Functionality with JavaServer Faces Technology 23313.3 Using Ajax with Facelets 23313.4 Sending an Ajax Request 23613.5 Monitoring Events on the Client 23813.6 Handling Errors 23813.7 Receiving an Ajax Response 23913.8 Ajax Request Lifecycle 24013.9 Grouping of Components 24013.10 Loading JavaScript as a Resource 24113.11 The ajaxguessnumber Example Application 24313.12 Further Information about Ajax in JavaServer Faces Technology 247Chapter 14: Composite Components: Advanced Topics and an Example 24914.1 Attributes of a Composite Component 24914.2 Invoking a Managed Bean 25114.3 Validating Composite Component Values 25114.4 The compositecomponentexample Example Application 251Chapter 15: Creating Custom UI Components and Other Custom Objects 25715.1 Determining Whether You Need a Custom Component or Renderer 25915.2 Understanding the Image Map Example 26215.3 Steps for Creating a Custom Component 26815.4 Creating Custom Component Classes 26815.5 Delegating Rendering to a Renderer 27815.6 Implementing an Event Listener 28115.7 Handling Events for Custom Components 28315.8 Defining the Custom Component Tag in a Tag Library Descriptor 28415.9 Using a Custom Component 28515.10 Creating and Using a Custom Converter 28715.11 Creating and Using a Custom Validator 29215.12 Binding Component Values and Instances to Managed Bean Properties 29815.13 Binding Converters, Listeners, and Validators to Managed Bean Properties 303Chapter 16: Configuring JavaServer Faces Applications 30516.1 Using Annotations to Configure Managed Beans 30616.2 Application Configuration Resource File 30716.3 Using Faces Flows 31116.4 Configuring Managed Beans 32316.5 Registering Application Messages 33216.6 Using Default Validators 33516.7 Registering a Custom Validator 33616.8 Registering a Custom Converter 33716.9 Configuring Navigation Rules 33716.10 Registering a Custom Renderer with a Render Kit 34016.11 Registering a Custom Component 34216.12 Basic Requirements of a JavaServer Faces Application 343Chapter 17: Java Servlet Technology 35117.1 What Is a Servlet? 35217.2 Servlet Lifecycle 35217.3 Sharing Information 35417.4 Creating and Initializing a Servlet 35617.5 Writing Service Methods 35617.6 Filtering Requests and Responses 35917.7 Invoking Other Web Resources 36317.8 Accessing the Web Context 36517.9 Maintaining Client State 36517.10 Finalizing a Servlet 36717.11 Uploading Files with Java Servlet Technology 37017.12 Asynchronous Processing 37217.13 Nonblocking I/O 37517.14 Protocol Upgrade Processing 37817.15 The mood Example Application 38117.16 The fileupload Example Application 38317.17 The dukeetf Example Application 38817.18 Further Information about Java Servlet Technology 394Chapter 18: Java API for WebSocket 39518.1 Introduction to WebSocket 39618.2 Creating WebSocket Applications in the Java EE Platform 39718.3 Programmatic Endpoints 39818.4 Annotated Endpoints 39918.5 Sending and Receiving Messages 40018.6 Maintaining Client State 40218.7 Using Encoders and Decoders 40318.8 Path Parameters 40618.9 Handling Errors 40718.10 Specifying an Endpoint Configurator Class 40718.11 The dukeetf2 Example Application 40818.12 The websocketbot Example Application 41318.13 Further Information about WebSocket 420Chapter 19: JSON Processing 42119.1 Introduction to JSON 42119.2 JSON Processing in the Java EE Platform 42319.3 Using the Object Model API 42519.4 Using the Streaming API 42919.5 JSON in Java EE RESTful Web Services 43119.6 The jsonpmodel Example Application 43219.7 The jsonpstreaming Example Application 43419.8 Further Information about the Java API for JSON Processing 436Chapter 20: Internationalizing and Localizing Web Applications 43720.1 Java Platform Localization Classes 43720.2 Providing Localized Messages and Labels 43820.3 Date and Number Formatting 44120.4 Character Sets and Encodings 442Part IV: Bean Validation 445Chapter 21: Introduction to Bean Validation 44721.1 Using Bean Validation Constraints 44721.2 Validating Null and Empty Strings 45021.3 Validating Constructors and Methods 45121.4 Further Information about Bean Validation 454Chapter 22: Bean Validation: Advanced Topics 45522.1 Creating Custom Constraints 45522.2 Customizing Validator Messages 45722.3 Grouping Constraints 45722.4 Using Method Constraints in Type Hierarchies 458Part V: Contexts and Dependency Injection for Java EE 461Chapter 23: Introduction to Contexts and Dependency Injection for Java EE 46323.1 Getting Started 46423.2 Overview of CDI 46623.3 About Beans 46723.4 About CDI Managed Beans 46823.5 Beans as Injectable Objects 46823.6 Using Qualifiers 46923.7 Injecting Beans 47023.8 Using Scopes 47123.9 Giving Beans EL Names 47323.10 Adding Setter and Getter Methods 47323.11 Using a Managed Bean in a Facelets Page 47423.12 Injecting Objects by Using Producer Methods 47423.13 Configuring a CDI Application 47523.14 Using the @PostConstruct and @PreDestroy Annotations with CDI Managed Bean Classes 47623.15 Further Information about CDI 477Chapter 24: Running the Basic Contexts and Dependency Injection Examples 47924.1 The simplegreeting CDI Example 47924.2 The guessnumber-cdi CDI Example 483Chapter 25: Contexts and Dependency Injection for Java EE: Advanced Topics 49325.1 Packaging CDI Applications 49325.2 Using Alternatives in CDI Applications 49425.3 Using Producer Methods, Producer Fields, and Disposer Methods in CDI Applications 49725.4 Using Predefined Beans in CDI Applications 49925.5 Using Events in CDI Applications 50125.6 Using Interceptors in CDI Applications 50425.7 Using Decorators in CDI Applications 50625.8 Using Stereotypes in CDI Applications 507Chapter 26: Running the Advanced Contexts and Dependency Injection Examples 51126.1 The encoder Example: Using Alternatives 51126.2 The producermethods Example: Using a Producer Method to Choose a Bean Implementation 51726.3 The producerfields Example: Using Producer Fields to Generate Resources 52026.4 The billpayment Example: Using Events and Interceptors 52726.5 The decorators Example: Decorating a Bean 535Part VI: Web Services 539Chapter 27: Introduction to Web Services 54127.1 What Are Web Services? 54127.2 Types of Web Services 54127.3 Deciding Which Type of Web Service to Use 544Chapter 28: Building Web Services with JAX-WS 54528.1 Creating a Simple Web Service and Clients with JAX-WS 54628.2 Types Supported by JAX-WS 55528.3 Web Services Interoperability and JAX-WS 55728.4 Further Information about JAX-WS 558Chapter 29: Building RESTful Web Services with JAX-RS 55929.1 What Are RESTful Web Services? 55929.2 Creating a RESTful Root Resource Class 56129.3 Example Applications for JAX-RS 57829.4 Further Information about JAX-RS 583Chapter 30: Accessing REST Resources with the JAX-RS Client API 58530.1 Overview of the Client API 58530.2 Using the Client API in the JAX-RS Example Applications 58930.3 Advanced Features of the Client API 592Chapter 31: JAX-RS: Advanced Topics and an Example 59731.1 Annotations for Field and Bean Properties of Resource Classes 59831.2 Validating Resource Data with Bean Validation 60131.3 Subresources and Runtime Resource Resolution 60431.4 Integrating JAX-RS with EJB Technology and CDI 60631.5 Conditional HTTP Requests 60831.6 Runtime Content Negotiation 60931.7 Using JAX-RS with JAXB 61131.8 The customer Example Application 618Index 627