The World Wide Web, restored to 800 pixels of glory.
GeezerVison is showing javaee.github.io — Java Platform, Enterprise Edition The Java EE Tutorial Java Platform, Enterprise Edition, Release 8
Audience
Documentation Accessibility
Before You Read This Book
Related Documentation
Conventions
Default Paths and File Names
Introduction to Java EE
Java EE 8 Platform Highlights
Java EE Application Model
Distributed Multitiered Applications
Security
Java EE Components
Java EE Clients
Web Clients
Application Clients
Applets
The JavaBeans Component Architecture
Java EE Server Communications
Web Components
Business Components
Enterprise Information System Tier
Java EE Containers
Container Services
Container Types
Web Services Support
XML
SOAP Transport Protocol
WSDL Standard Format
Java EE Application Assembly and Deployment
Java EE 8 APIs
Enterprise JavaBeans Technology
Java Servlet Technology
JavaServer Faces Technology
JavaServer Pages Technology
JavaServer Pages Standard Tag Library
Java Persistence API
Java Transaction API
Java API for RESTful Web Services
Managed Beans
Contexts and Dependency Injection for Java EE
Dependency Injection for Java
Bean Validation
Java Message Service API
Java EE Connector Architecture
JavaMail API
Java Authorization Contract for Containers
Java Authentication Service Provider Interface for Containers
Java EE Security API
Java API for WebSocket
Java API for JSON Processing
Java API for JSON Binding
Concurrency Utilities for Java EE
Batch Applications for the Java Platform
Java EE 8 APIs in the Java Platform, Standard Edition 8
Java Database Connectivity API
Java Naming and Directory Interface API
JavaBeans Activation Framework
Java API for XML Processing
Java Architecture for XML Binding
Java API for XML Web Services
SOAP with Attachments API for Java
Java Authentication and Authorization Service
Common Annotations for the Java Platform
GlassFish Server Tools
Required Software
Java Platform, Standard Edition
Java EE 8 Software Development Kit
SDK Installation Tips
Java EE 8 Tutorial Component
NetBeans IDE
To Install NetBeans IDE without GlassFish Server
To Add GlassFish Server as a Server Using NetBeans IDE
Apache Maven
Starting and Stopping GlassFish Server
To Start GlassFish Server Using NetBeans IDE
To Stop GlassFish Server Using NetBeans IDE
To Start GlassFish Server Using the Command Line
To Stop GlassFish Server Using the Command Line
Starting the Administration Console
To Start the Administration Console Using NetBeans IDE
Starting and Stopping Apache Derby
To Start the Database Server Using NetBeans IDE
Building the Examples
Tutorial Example Directory Structure
Java EE Maven Archetypes in the Tutorial
Installing the Tutorial Archetypes
Installing the Tutorial Archetypes Using NetBeans IDE
Installing the Tutorial Archetypes Using Maven
Debugging Java EE Applications
Using the Server Log
To Use the Administration Console Log Viewer
Using a Debugger
To Debug an Application Using a Debugger
Resources and JNDI Naming
DataSource Objects and Connection Pools
Creating Resources Administratively
Resource Injection
Dependency Injection
The Main Differences between Resource Injection and Dependency Injection
Packaging Applications
Packaging Enterprise Beans
Packaging Enterprise Beans in EJB JAR Modules
Packaging Enterprise Beans in WAR Modules
Packaging Web Archives
Packaging Resource Adapter Archives
Web Applications
Web Application Lifecycle
A Web Module That Uses JavaServer Faces Technology: The hello1 Example
To View the hello1 Web Module Using NetBeans IDE
Introduction to Scopes
Packaging and Deploying the hello1 Web Module
To Build and Package the hello1 Web Module Using NetBeans IDE
To Build and Package the hello1 Web Module Using Maven
Viewing Deployed Web Modules
To View Deployed Web Modules Using the Administration Console
To View Deployed Web Modules Using the asadmin Command
To View Deployed Web Modules Using NetBeans IDE
Running the Deployed hello1 Web Module
Dynamic Reloading of Deployed Modules
Undeploying the hello1 Web Module
To Undeploy the hello1 Web Module Using NetBeans IDE
To Undeploy the hello1 Web Module Using Maven
A Web Module That Uses Java Servlet Technology: The hello2 Example
Mapping URLs to Web Components
Examining the hello2 Web Module
To View the hello2 Web Module Using NetBeans IDE
Running the hello2 Example
To Run the hello2 Example Using NetBeans IDE
To Run the hello2 Example Using Maven
Configuring Web Applications
Setting Context Parameters
To Add a Context Parameter Using NetBeans IDE
To Create a web.xml File Using NetBeans IDE
Declaring Welcome Files
Mapping Errors to Error Screens
To Set Up Error Mapping Using NetBeans IDE
Declaring Resource References
Declaring a Reference to a Resource
Declaring a Reference to a Web Service
Further Information about Web Applications
Introduction to JavaServer Faces Technology
What Is a JavaServer Faces Application?
JavaServer Faces Technology Benefits
A Simple JavaServer Faces Application
User Interface Component Model
User Interface Component Classes
Component Rendering Model
Conversion Model
Event and Listener Model
Validation Model
Navigation Model
The Lifecycle of a JavaServer Faces Application
Overview of the JavaServer Faces Lifecycle
Restore View Phase
Apply Request Values Phase
Process Validations Phase
Update Model Values Phase
Invoke Application Phase
Render Response Phase
Partial Processing and Partial Rendering
Further Information about JavaServer Faces Technology
What Is Facelets?
The Lifecycle of a Facelets Application
Developing a Simple Facelets Application: The guessnumber-jsf Example Application
Creating a Facelets Application
Developing a Managed Bean
Creating Facelets Views
Configuring the Application
Running the guessnumber-jsf Facelets Example
To Build, Package, and Deploy the guessnumber-jsf Example Using NetBeans IDE
To Build, Package, and Deploy the guessnumber-jsf Example Using Maven
To Run the guessnumber-jsf Example
Using Facelets Templates
Composite Components
Web Resources
Relocatable Resources
Resource Library Contracts
The hello1-rlc Example Application
Configuring the hello1-rlc Example
The Facelets Pages for the hello1-rlc Example
To Build, Package, and Deploy the hello1-rlc Example Using NetBeans IDE
To Build, Package, and Deploy the hello1-rlc Example Using Maven
To Run the hello1-rlc Example
HTML5-Friendly Markup
Using Pass-Through Elements
Using Pass-Through Attributes
The reservation Example Application
The Facelets Pages for the reservation Application
The Managed Bean for the reservation Application
To Build, Package, and Deploy the reservation Example Using NetBeans IDE
To Build, Package, and Deploy the reservation Example Using Maven
To Run the reservation Example
Overview of the EL
Immediate and Deferred Evaluation Syntax
Immediate Evaluation
Deferred Evaluation
Value and Method Expressions
Value Expressions
Referencing Objects
Referencing Object Properties or Collection Elements
Referencing Literals
Parameterized Method Calls
Where Value Expressions Can Be Used
Method Expressions
Lambda Expressions
Operations on Collection Objects
Operators
Reserved Words
Examples of EL Expressions
Further Information about the Expression Language
Setting Up a Page
Adding Components to a Page Using HTML Tag Library Tags
Common Component Tag Attributes
The id Attribute
The immediate Attribute
The rendered Attribute
The style and styleClass Attributes
The value and binding Attributes
Adding HTML Head and Body Tags
Adding a Form Component
Using Text Components
Rendering a Field with the h:inputText Tag
Rendering a Password Field with the h:inputSecret Tag
Rendering a Label with the h:outputLabel Tag
Rendering a Link with the h:outputLink Tag
Displaying a Formatted Message with the h:outputFormat Tag
Using Command Component Tags for Performing Actions and Navigation
Rendering a Button with the h:commandButton Tag
Rendering a Link with the h:commandLink Tag
Adding Graphics and Images with the h:graphicImage Tag
Laying Out Components with the h:panelGrid and h:panelGroup Tags
Displaying Components for Selecting One Value
Displaying a Check Box Using the h:selectBooleanCheckbox Tag
Displaying a Menu Using the h:selectOneMenu Tag
Displaying Components for Selecting Multiple Values
Using the f:selectItem and f:selectItems Tags
Using the f:selectItems Tag
Using the f:selectItem Tag
Displaying the Results from Selection Components
Using Data-Bound Table Components
Displaying Error Messages with the h:message and h:messages Tags
Creating Bookmarkable URLs with the h:button and h:link Tags
Using View Parameters to Configure Bookmarkable URLs
The bookmarks Example Application
To Build, Package, and Deploy the bookmarks Example Using NetBeans IDE
To Build, Package, and Deploy the bookmarks Example Using Maven
To Run the bookmarks Example
Resource Relocation Using h:outputScript and h:outputStylesheet Tags
Using Core Tags
Using the Standard Converters
Converting a Component’s Value
Using DateTimeConverter
Using NumberConverter
Registering Listeners on Components
Registering a Value-Change Listener on a Component
Registering an Action Listener on a Component
Using the Standard Validators
Validating a Component’s Value
Using Validator Tags
Referencing a Managed Bean Method
Referencing a Method That Performs Navigation
Referencing a Method That Handles an Action Event
Referencing a Method That Performs Validation
Referencing a Method That Handles a Value-Change Event
Managed Beans in JavaServer Faces Technology
Creating a Managed Bean
Using the EL to Reference Managed Beans
Writing Bean Properties
Writing Properties Bound to Component Values
UIInput and UIOutput Properties
UIData Properties
UISelectBoolean Properties
UISelectMany Properties
UISelectOne Properties
UISelectItem Properties
UISelectItems Properties
Writing Properties Bound to Component Instances
Writing Properties Bound to Converters, Listeners, or Validators
Writing Managed Bean Methods
Why Use Managed Beans
Writing a Method to Handle Navigation
Writing a Method to Handle an Action Event
Writing a Method to Perform Validation
Writing a Method to Handle a Value-Change Event
Overview of Ajax
Using Ajax Functionality with JavaServer Faces Technology
Using Ajax with Facelets
Using the f:ajax Tag
Sending an Ajax Request
Using the event Attribute
Using the execute Attribute
Using the immediate Attribute
Using the listener Attribute
Monitoring Events on the Client
Handling Errors
Receiving an Ajax Response
Ajax Request Lifecycle
Grouping of Components
Loading JavaScript as a Resource
Using JavaScript API in a Facelets Application
Using the @ResourceDependency Annotation in a Bean Class
The ajaxguessnumber Example Application
The ajaxguessnumber Source Files
The ajaxgreeting.xhtml Facelets Page
The UserNumberBean Backing Bean
The DukesNumberBean CDI Managed Bean
Running the ajaxguessnumber Example
To Build, Package, and Deploy the ajaxguessnumber Example Using NetBeans IDE
To Build, Package, and Deploy the ajaxguessnumber Example Using Maven
To Run the ajaxguessnumber Example
Further Information about Ajax in JavaServer Faces Technology
Attributes of a Composite Component
Invoking a Managed Bean
Validating Composite Component Values
The compositecomponentexample Example Application
The Composite Component File
The Using Page
The Managed Bean
Running the compositecomponentexample Example
To Build, Package, and Deploy the compositecomponentexample Example Using NetBeans IDE
To Build, Package, and Deploy the compositecomponentexample Example Using Maven
To Run the compositecomponentexample Example
Introduction to Creating Custom Components
Determining Whether You Need a Custom Component or Renderer
When to Use a Custom Component
When to Use a Custom Renderer
Component, Renderer, and Tag Combinations
Understanding the Image Map Example
Why Use JavaServer Faces Technology to Implement an Image Map?
Understanding the Rendered HTML
Understanding the Facelets Page
Configuring Model Data
Summary of the Image Map Application Classes
Steps for Creating a Custom Component
Creating Custom Component Classes
Specifying the Component Family
Performing Encoding
Performing Decoding
Enabling Component Properties to Accept Expressions
Saving and Restoring State
Delegating Rendering to a Renderer
Creating the Renderer Class
Identifying the Renderer Type
Implementing an Event Listener
Implementing Value-Change Listeners
Implementing Action Listeners
Handling Events for Custom Components
Defining the Custom Component Tag in a Tag Library Descriptor
Using a Custom Component
Creating and Using a Custom Converter
Creating a Custom Converter
Using a Custom Converter
Creating and Using a Custom Validator
Implementing the Validator Interface
Specifying a Custom Tag
Using a Custom Validator
Binding Component Values and Instances to Managed Bean Properties
Binding a Component Value to a Property
Binding a Component Value to an Implicit Object
Binding a Component Instance to a Bean Property
Binding Converters, Listeners, and Validators to Managed Bean Properties
Introduction to Configuring JavaServer Faces Applications
Using Annotations to Configure Managed Beans
Using Managed Bean Scopes
Application Configuration Resource File
Configuring Eager Application-Scoped Managed Beans
Ordering of Application Configuration Resource Files
Using Faces Flows
Packaging Flows in an Application
The Simplest Possible Flow: The simple-flow Example Application
To Build, Package, and Deploy the simple-flow Example Using NetBeans IDE
To Build, Package, and Deploy the simple-flow Example Using Maven
To Run the simple-flow Example
The checkout-module Example Application
The Facelets Pages for the checkout-module Example
Using a Configuration File to Configure a Flow
Using a Java Class to Configure a Flow
The Flow-Scoped Managed Beans
To Build, Package, and Deploy the checkout-module Example Using NetBeans IDE
To Build, Package, and Deploy the checkout-module Example Using Maven
To Run the checkout-module Example
Configuring Managed Beans
Using the managed-bean Element
Initializing Properties Using the managed-property Element
Referencing a Java Enum Type
Referencing a Context Initialization Parameter
Initializing Map Properties
Initializing Array and List Properties
Initializing Managed Bean Properties
Initializing Maps and Lists
Registering Application Messages
Using FacesMessage to Create a Message
Referencing Error Messages
Using Default Validators
Registering a Custom Validator
Registering a Custom Converter
Configuring Navigation Rules
Registering a Custom Renderer with a Render Kit
Registering a Custom Component
Basic Requirements of a JavaServer Faces Application
Configuring an Application with a Web Deployment Descriptor
Identifying the Servlet for Lifecycle Processing
To Specify a Path to an Application Configuration Resource File
To Specify Where State Is Saved
Configuring Project Stage
Including the Classes, Pages, and Other Resources
About WebSockets in JSF
Configuring WebSockets
WebSocket Usage: Client Side
WebSocket Usage: Server Side
Using the f:websocket Tag
WebSocket Scopes and Users
Conditionally Connecting WebSockets
WebSocket Events: Server
WebSocket Events: Clients
WebSocket Security Considerations
Using Ajax With WebSockets
What Is a Servlet?
Servlet Lifecycle
Handling Servlet Lifecycle Events
Defining the Listener Class
Handling Servlet Errors
Sharing Information
Using Scope Objects
Controlling Concurrent Access to Shared Resources
Creating and Initializing a Servlet
Writing Service Methods
Getting Information from Requests
Constructing Responses
Filtering Requests and Responses
Programming Filters
Programming Customized Requests and Responses
Specifying Filter Mappings
To Specify Filter Mappings Using NetBeans IDE
Invoking Other Web Resources
Including Other Resources in the Response
Transferring Control to Another Web Component
Accessing the Web Context
Maintaining Client State
Accessing a Session
Associating Objects with a Session
Session Management
To Set the Timeout Period Using NetBeans IDE
Session Tracking
Finalizing a Servlet
Tracking Service Requests
Notifying Methods to Shut Down
Creating Polite Long-Running Methods
Uploading Files with Java Servlet Technology
The @MultipartConfig Annotation
The getParts and getPart Methods
Asynchronous Processing
Asynchronous Processing in Servlets
Waiting for a Resource
Nonblocking I/O
Reading a Large HTTP POST Request Using Nonblocking I/O
Protocol Upgrade Processing
Server Push
HTTP Trailer
The mood Example Application
Components of the mood Example Application
Running the mood Example
To Run the mood Example Using NetBeans IDE
To Run the mood Example Using Maven
The fileupload Example Application
Architecture of the fileupload Example Application
Running the fileupload Example
To Build, Package, and Deploy the fileupload Example Using NetBeans IDE
To Build, Package, and Deploy the fileupload Example Using Maven
To Run the fileupload Example
The dukeetf Example Application
Architecture of the dukeetf Example Application
The Servlet
The Enterprise Bean
The HTML Page
Running the dukeetf Example Application
To Run the dukeetf Example Application Using NetBeans IDE
To Run the dukeetf Example Application Using Maven
Further Information about Java Servlet Technology
Introduction to WebSocket
Creating WebSocket Applications in the Java EE Platform
Creating and Deploying a WebSocket Endpoint
Programmatic Endpoints
Annotated Endpoints
Sending and Receiving Messages
Sending Messages
Sending Messages to All Peers Connected to an Endpoint
Receiving Messages
Using Encoders and Decoders
Implementing Encoders to Convert Java Objects into WebSocket Messages
Implementing Decoders to Convert WebSocket Messages into Java Objects
Path Parameters
Specifying an Endpoint Configurator Class
The dukeetf2 Example Application
Architecture of the dukeetf2 Sample Application
The Endpoint
Running the dukeetf2 Example Application
To Run the dukeetf2 Example Application Using NetBeans IDE
To Run the dukeetf2 Example Application Using Maven
The websocketbot Example Application
Architecture of the websocketbot Example Application
The CDI Bean
The WebSocket Endpoint
The Application Messages
The Encoder Classes
The Message Decoder
Running the websocketbot Example Application
To Run the websocketbot Example Application Using NetBeans IDE
To Run the websocketbot Example Application Using Maven
To Test the websocketbot Example Application
Further Information about WebSocket
Introduction to JSON
JSON Syntax
Uses of JSON
Generating and Parsing JSON Data
JSON Processing in the Java EE Platform
Using the Object Model API
Creating an Object Model from JSON Data
Creating an Object Model from Application Code
Navigating an Object Model
Writing an Object Model to a Stream
Using the Streaming API
Reading JSON Data Using a Parser
Writing JSON Data Using a Generator
JSON in Java EE RESTful Web Services
The jsonpmodel Example Application
Components of the jsonpmodel Example Application
Running the jsonpmodel Example Application
To Run the jsonpmodel Example Application Using NetBeans IDE
To Run the jsonpmodel Example Application Using Maven
The jsonpstreaming Example Application
Components of the jsonpstreaming Example Application
Running the jsonpstreaming Example Application
To Run the jsonpstreaming Example Application Using NetBeans IDE
To Run the jsonpstreaming Example Application Using Maven
Further Information about the Java API for JSON Processing
JSON Binding in the Java EE Platform
Overview of the JSON Binding API
Creating a jasonb Instance
Using the Default Mapping
Using Customizations
Using Annotations
Running the jsonbbasics Example Application
Components of the jsonbbasics Example Application
Further Information about the Java API for JSON Binding
Java Platform Localization Classes
Providing Localized Messages and Labels
Establishing the Locale
Setting the Resource Bundle
Retrieving Localized Messages
Date and Number Formatting
Character Sets and Encodings
Character Sets
Character Encoding
Overview of Bean Validation
Using Bean Validation Constraints
Validating Null and Empty Strings
Validating Constructors and Methods
Cross-Parameter Constraints
Identifying Parameter Constraint Violations
Adding Constraints to Method Return Values
Further Information about Bean Validation
Creating Custom Constraints
Using the Built-In Constraints to Make a New Constraint
Removing Ambiguity in Constraint Targets
Customizing Validator Messages
The ValidationMessages Resource Bundle
Localizing Validation Messages
Grouping Constraints
Customizing Group Validation Order
Using Method Constraints in Type Hierarchies
Rules for Using Method Constraints in Type Hierarchies
Getting Started
Overview of CDI
About Beans
About CDI Managed Beans
Beans as Injectable Objects
Using Qualifiers
Injecting Beans
Using Scopes
Giving Beans EL Names
Adding Setter and Getter Methods
Using a Managed Bean in a Facelets Page
Injecting Objects by Using Producer Methods
Configuring a CDI Application
Using the @PostConstruct and @PreDestroy Annotations with CDI Managed Bean Classes
To Initialize a Managed Bean Using the @PostConstruct Annotation
To Prepare for the Destruction of a Managed Bean Using the @PreDestroy Annotation
Further Information about CDI
Building and Running the CDI Samples
The simplegreeting CDI Example
The simplegreeting Source Files
The Facelets Template and Page
Running the simplegreeting Example
To Build, Package, and Run the simplegreeting Example Using NetBeans IDE
To Build, Package, and Deploy the simplegreeting Example Using Maven
To Run the simplegreeting Example
The guessnumber-cdi CDI Example
The guessnumber-cdi Source Files
The @MaxNumber and @Random Qualifier Interfaces
The Generator Managed Bean
The UserNumberBean Managed Bean
The Facelets Page
Running the guessnumber-cdi Example
To Build, Package, and Deploy the guessnumber-cdi Example Using NetBeans IDE
To Build, Package, and Deploy the guessnumber-cdi Example Using Maven
To Run the guessnumber Example
Packaging CDI Applications
Using Alternatives in CDI Applications
Using Specialization
Using Producer Methods, Producer Fields, and Disposer Methods in CDI Applications
Using Producer Methods
Using Producer Fields to Generate Resources
Using a Disposer Method
Using Predefined Beans in CDI Applications
Using Events in CDI Applications
Defining Events
Using Observer Methods to Handle Events
Firing Events
Using Interceptors in CDI Applications
Using Decorators in CDI Applications
Using Stereotypes in CDI Applications
Using the Built-In Annotation Literals
Using the Configurators Interfaces
The Bootstrap API
Configuring the CDI Container
Building and Running the CDI Advanced Examples
The encoder Example: Using Alternatives
The Coder Interface and Implementations
The encoder Facelets Page and Managed Bean
Running the encoder Example
To Build, Package, and Deploy the encoder Example Using NetBeans IDE
To Run the encoder Example Using NetBeans IDE
To Build, Package, and Deploy the encoder Example Using Maven
To Run the encoder Example Using Maven
The producermethods Example: Using a Producer Method to Choose a Bean Implementation
Components of the producermethods Example
Running the producermethods Example
To Build, Package, and Deploy the producermethods Example Using NetBeans IDE
To Build, Package, and Deploy the producermethods Example Using Maven
To Run the producermethods Example
The producerfields Example: Using Producer Fields to Generate Resources
The Producer Field for the producerfields Example
The producerfields Entity and Session Bean
The producerfields Facelets Pages and Managed Bean
Running the producerfields Example
To Build, Package, and Deploy the producerfields Example Using NetBeans IDE
To Build, Package, and Deploy the producerfields Example Using Maven
To Run the producerfields Example
The billpayment Example: Using Events and Interceptors
Overview of the billpayment Example
The PaymentEvent Event Class
The PaymentHandler Event Listener
The billpayment Facelets Pages and Managed Bean
The LoggedInterceptor Interceptor Class
Running the billpayment Example
To Build, Package, and Deploy the billpayment Example Using NetBeans IDE
To Build, Package, and Deploy the billpayment Example Using Maven
To Run the billpayment Example
The decorators Example: Decorating a Bean
Overview of the decorators Example
Components of the decorators Example
Running the decorators Example
To Build, Package, and Deploy the decorators Example Using NetBeans IDE
To Build, Package, and Deploy the decorators Example Using Maven
To Run the decorators Example
What Are Web Services?
Types of Web Services
"Big" Web Services
RESTful Web Services
Deciding Which Type of Web Service to Use
Overview of Java API for XML Web Services
Creating a Simple Web Service and Clients with JAX-WS
Basic Steps for Creating a Web Service and Client
Requirements of a JAX-WS Endpoint
Coding the Service Endpoint Implementation Class
Building, Packaging, and Deploying the Service
To Build, Package, and Deploy the Service Using NetBeans IDE
To Build, Package, and Deploy the Service Using Maven
Testing the Methods of a Web Service Endpoint
To Test the Service without a Client
A Simple JAX-WS Application Client
Coding the Application Client
Running the Application Client
A Simple JAX-WS Web Client
Coding the Servlet
Running the Web Client
Types Supported by JAX-WS
Schema-to-Java Mapping
Java-to-Schema Mapping
Web Services Interoperability and JAX-WS
Further Information about JAX-WS
What Are RESTful Web Services?
Creating a RESTful Root Resource Class
Developing RESTful Web Services with JAX-RS
Overview of a JAX-RS Application
The @Path Annotation and URI Path Templates
Responding to HTTP Methods and Requests
The Request Method Designator Annotations
Using Entity Providers to Map HTTP Response and Request Entity Bodies
Using @Consumes and @Produces to Customize Requests and Responses
The @Produces Annotation
The @Consumes Annotation
Extracting Request Parameters
Configuring JAX-RS Applications
Configuring a JAX-RS Application Using a Subclass of Application
Configuring the Base URI in web.xml
Example Applications for JAX-RS
Creating a Simple RESTful Web Service
To Create a RESTful Web Service Using NetBeans IDE
The rsvp Example Application
Components of the rsvp Example Application
Running the rsvp Example Application
Real-World Examples
Further Information about JAX-RS
Overview of the Client API
Creating a Basic Client Request Using the Client API
Obtaining the Client Instance
Setting the Client Target
Setting Path Parameters in Targets
Invoking the Request
Using the Client API in the JAX-RS Example Applications
The Client API in the rsvp Example Application
The Client API in the customer Example Application
Advanced Features of the Client API
Configuring the Client Request
Setting Message Headers in the Client Request
Setting Cookies in the Client Request
Adding Filters to the Client
Asynchronous Invocations in the Client API
Using Custom Callbacks in Asynchronous Invocations
Using Reactive Approach in Asynchronous Invocations
Using Server-Sent Events
Overview of the SSE API
Broadcasting Using SSE
Listening and Receiving Events
Annotations for Field and Bean Properties of Resource Classes
Extracting Path Parameters
Extracting Query Parameters
Extracting Form Data
Extracting the Java Type of a Request or Response
Validating Resource Data with Bean Validation
Using Constraint Annotations on Resource Methods
Validating Entity Data
Validation Exception Handling and Response Codes
Subresources and Runtime Resource Resolution
Subresource Methods
Subresource Locators
Integrating JAX-RS with EJB Technology and CDI
Conditional HTTP Requests
Runtime Content Negotiation
Using JAX-RS with JAXB
Using Java Objects to Model Your Data
Starting from an Existing XML Schema Definition
Using JSON with JAX-RS and JAXB
The customer Example Application
Overview of the customer Example Application
The Customer and Address Entity Classes
The CustomerService Class
Using the JAX-RS Client in the CustomerBean Classes
Running the customer Example
To Build, Package, and Deploy the customer Example Using NetBeans IDE
To Build, Package, and Deploy the customer Example Using Maven
What Is an Enterprise Bean?
Benefits of Enterprise Beans
When to Use Enterprise Beans
Types of Enterprise Beans
What Is a Session Bean?
Types of Session Beans
Stateful Session Beans
Stateless Session Beans
Singleton Session Beans
When to Use Session Beans
What Is a Message-Driven Bean?
What Makes Message-Driven Beans Different from Session Beans?
When to Use Message-Driven Beans
Accessing Enterprise Beans
Using Enterprise Beans in Clients
Portable JNDI Syntax
Deciding on Remote or Local Access
Local Clients
Accessing Local Enterprise Beans Using the No-Interface View
Accessing Local Enterprise Beans That Implement Business Interfaces
Remote Clients
Web Service Clients
Method Parameters and Access
Isolation
Granularity of Accessed Data
The Contents of an Enterprise Bean
Naming Conventions for Enterprise Beans
The Lifecycles of Enterprise Beans
The Lifecycle of a Stateful Session Bean
The Lifecycle of a Stateless Session Bean
The Lifecycle of a Singleton Session Bean
The Lifecycle of a Message-Driven Bean
Further Information about Enterprise Beans
Starting With Enterprise Beans
Creating the Enterprise Bean
Coding the Enterprise Bean Class
Creating the converter Web Client
Running the converter Example
To Run the converter Example Using NetBeans IDE
To Run the converter Example Using Maven
Modifying the Java EE Application
To Modify a Class File
Overview of the EJB Examples
The cart Example
The Business Interface
Session Bean Class
Lifecycle Callback Methods
Business Methods
The @Remove Method
Helper Classes
Running the cart Example
To Run the cart Example Using NetBeans IDE
To Run the cart Example Using Maven
A Singleton Session Bean Example: counter
Creating a Singleton Session Bean
Initializing Singleton Session Beans
Managing Concurrent Access in a Singleton Session Bean
Handling Errors in a Singleton Session Bean
The Architecture of the counter Example
Running the counter Example
To Run the counter Example Using NetBeans IDE
To Run the counter Example Using Maven
A Web Service Example: helloservice
The Web Service Endpoint Implementation Class
Stateless Session Bean Implementation Class
Running the helloservice Example
To Build, Package, and Deploy the helloservice Example Using NetBeans IDE
To Build, Package, and Deploy the helloservice Example Using Maven
Using the Timer Service
Creating Calendar-Based Timer Expressions
Specifying Multiple Values in Calendar Expressions
Programmatic Timers
The @Timeout Method
Creating Programmatic Timers
Automatic Timers
Canceling and Saving Timers
Getting Timer Information
Transactions and Timers
The timersession Example
Running the timersession Example
To Run the timersession Example Using NetBeans IDE
To Build, Package, and Deploy the timersession Example Using Maven
To Run the Web Client
Handling Exceptions
Overview of the Embedded Enterprise Bean Container
Developing Embeddable Enterprise Bean Applications
Running Embedded Applications
Creating the Enterprise Bean Container
Explicitly Specifying Enterprise Bean Modules to Be Initialized
Looking Up Session Bean References
Shutting Down the Enterprise Bean Container
The standalone Example Application
Overview of the standalone Example Application
To Run the standalone Example Application Using NetBeans IDE
To Run the standalone Example Application Using Maven
Asynchronous Method Invocation
Creating an Asynchronous Business Method
Calling Asynchronous Methods from Enterprise Bean Clients
Retrieving the Final Result from an Asynchronous Method Invocation
Cancelling an Asynchronous Method Invocation
Checking the Status of an Asynchronous Method Invocation
The async Example Application
Architecture of the async-war Module
Running the async Example
To Run the async Example Application Using NetBeans IDE
To Run the async Example Application Using Maven
Overview of the Java Persistence API
Entities
Requirements for Entity Classes
Persistent Fields and Properties in Entity Classes
Persistent Fields
Persistent Properties
Using Collections in Entity Fields and Properties
Validating Persistent Fields and Properties
Primary Keys in Entities
Multiplicity in Entity Relationships
Direction in Entity Relationships
Bidirectional Relationships
Unidirectional Relationships
Queries and Relationship Direction
Cascade Operations and Relationships
Orphan Removal in Relationships
Embeddable Classes in Entities
Entity Inheritance
Abstract Entities
Mapped Superclasses
Non-Entity Superclasses
Entity Inheritance Mapping Strategies
The Single Table per Class Hierarchy Strategy
The Table per Concrete Class Strategy
The Joined Subclass Strategy
Managing Entities
The EntityManager Interface
Container-Managed Entity Managers
Application-Managed Entity Managers
Finding Entities Using the EntityManager
Managing an Entity Instance’s Lifecycle
Persisting Entity Instances
Removing Entity Instances
Synchronizing Entity Data to the Database
Persistence Units
Querying Entities
Database Schema Creation
Configuring an Application to Create or Drop Database Tables
Loading Data Using SQL Scripts
Further Information about Persistence
Overview of the Persistence Examples
The order Application
Entity Relationships in the order Application
Self-Referential Relationships
One-to-One Relationships
One-to-Many Relationship Mapped to Overlapping Primary and Foreign Keys
Primary Keys in the order Application
Generated Primary Keys
Compound Primary Keys
Entity Mapped to More Than One Database Table
Cascade Operations in the order Application
BLOB and CLOB Database Types in the order Application
Temporal Types in the order Application
Managing the order Application’s Entities
Creating Entities
Finding Entities
Setting Entity Relationships
Using Queries
Removing Entities
Running the order Example
To Run the order Example Using NetBeans IDE
To Run the order Example Using Maven
The roster Application
Relationships in the roster Application
The Many-To-Many Relationship in roster
Entity Inheritance in the roster Application
Criteria Queries in the roster Application
Metamodel Classes in the roster Application
Obtaining a CriteriaBuilder Instance in RequestBean
Creating Criteria Queries in RequestBean’s Business Methods
Automatic Table Generation in the roster Application
Running the roster Example
To Run the roster Example Using NetBeans IDE
To Run the roster Example Using Maven
The address-book Application
Bean Validation Constraints in address-book
Specifying Error Messages for Constraints in address-book
Validating Contact Input from a JavaServer Faces Application
Running the address-book Example
To Run the address-book Example Using NetBeans IDE
To Run the address-book Example Using Maven
Overview of the Java Persistence Query Language
Query Language Terminology
Creating Queries Using the Java Persistence Query Language
Named Parameters in Queries
Positional Parameters in Queries
Simplified Query Language Syntax
Select Statements
Update and Delete Statements
Example Queries
Simple Queries
A Basic Select Query
Eliminating Duplicate Values
Using Named Parameters
Queries That Navigate to Related Entities
A Simple Query with Relationships
Navigating to Single-Valued Relationship Fields
Traversing Relationships with an Input Parameter
Traversing Multiple Relationships
Navigating According to Related Fields
Queries with Other Conditional Expressions
The LIKE Expression
The IS NULL Expression
The IS EMPTY Expression
The BETWEEN Expression
Comparison Operators
Bulk Updates and Deletes
Update Queries
Delete Queries
Full Query Language Syntax
BNF Symbols
BNF Grammar of the Java Persistence Query Language
FROM Clause
Identifiers
Identification Variables
Range Variable Declarations
Collection Member Declarations
Joins
Path Expressions
Examples of Path Expressions
Expression Types
Navigation
WHERE Clause
Literals
Input Parameters
Conditional Expressions
Operators and Their Precedence
BETWEEN Expressions
IN Expressions
LIKE Expressions
NULL Comparison Expressions
Empty Collection Comparison Expressions
Collection Member Expressions
Subqueries
Functional Expressions
Case Expressions
NULL Values
Equality Semantics
SELECT Clause
Return Types
The DISTINCT Keyword
Constructor Expressions
ORDER BY Clause
GROUP BY and HAVING Clauses
Overview of the Criteria and Metamodel APIs
Using the Metamodel API to Model Entity Classes
Using Metamodel Classes
Using the Criteria API and Metamodel API to Create Basic Typesafe Queries
Creating a Criteria Query
Query Roots
Querying Relationships Using Joins
Path Navigation in Criteria Queries
Restricting Criteria Query Results
The Expression Interface Methods
Expression Methods in the CriteriaBuilder Interface
Managing Criteria Query Results
Ordering Results
Grouping Results
Executing Queries
Single-Valued Query Results
Collection-Valued Query Results
Overview of String-Based Criteria API Queries
Creating String-Based Queries
Executing String-Based Queries
Overview of Entity Locking and Concurrency
Using Optimistic Locking
Lock Modes
Setting the Lock Mode
Using Pessimistic Locking
Pessimistic Locking Timeouts
Overview of Using Fetch Plans and Entity Graphs
Entity Graph Basics
The Default Entity Graph
Using Entity Graphs in Persistence Operations
Fetch Graphs
Load Graphs
Using Named Entity Graphs
Applying Named Entity Graph Annotations to Entity Classes
Obtaining EntityGraph Instances from Named Entity Graphs
Using Entity Graphs in Query Operations
Overview of the Second-Level Cache
Controlling whether Entities May Be Cached
Specifying the Cache Mode Settings to Improve Performance
Setting the Cache Retrieval and Store Modes
Cache Retrieval Mode
Cache Store Mode
Setting the Cache Retrieval or Store Mode
Controlling the Second-Level Cache Programmatically
Overview of the javax.persistence.Cache Interface
Checking whether an Entity’s Data Is Cached
Removing an Entity from the Cache
Removing All Data from the Cache
Overview of the JMS API
What Is Messaging?
What Is the JMS API?
When Can You Use the JMS API?
How Does the JMS API Work with the Java EE Platform?
Basic JMS API Concepts
JMS API Architecture
Messaging Styles
Point-to-Point Messaging Style
Publish/Subscribe Messaging Style
Message Consumption
The JMS API Programming Model
JMS Administered Objects
JMS Connection Factories
JMS Destinations
Connections
Sessions
JMSContext Objects
JMS Message Producers
JMS Message Consumers
JMS Message Listeners
JMS Message Selectors
Consuming Messages from Topics
Creating Durable Subscriptions
Creating Shared Subscriptions
JMS Messages
Message Headers
Message Properties
Message Bodies
JMS Queue Browsers
JMS Exception Handling
Using Advanced JMS Features
Controlling Message Acknowledgment
Specifying Options for Sending Messages
Specifying Message Persistence
Setting Message Priority Levels
Allowing Messages to Expire
Specifying a Delivery Delay
Using JMSProducer Method Chaining
Creating Temporary Destinations
Using JMS Local Transactions
Sending Messages Asynchronously
Using the JMS API in Java EE Applications
Overview of Using the JMS API
Creating Resources for Java EE Applications
Using Resource Injection in Enterprise Bean or Web Components
Injecting a ConnectionFactory, Queue, or Topic
Injecting a JMSContext Object
Using Java EE Components to Produce and to Synchronously Receive Messages
Managing JMS Resources in Web and EJB Components
Managing Transactions in Session Beans
Using Message-Driven Beans to Receive Messages Asynchronously
Managing JTA Transactions
Further Information about JMS
Building and Running Java Message Service Examples
Overview of the JMS Examples
Writing Simple JMS Applications
Overview of Writing Simple JMS Application
Starting the JMS Provider
Creating JMS Administered Objects
To Create Resources for the Simple Examples
Building All the Simple Examples
To Build All the Simple Examples Using NetBeans IDE
To Build All the Simple Examples Using Maven
General Steps Performed in the Example
The Producer.java Client
To Run the Producer Client
Receiving Messages Synchronously
The SynchConsumer.java Client
To Run the SynchConsumer and Producer Clients
Using a Message Listener for Asynchronous Message Delivery
Writing the AsynchConsumer.java and TextListener.java Clients
To Run the AsynchConsumer and Producer Clients
Browsing Messages on a Queue
The MessageBrowser.java Client
To Run the QueueBrowser Client
Running Multiple Consumers on the Same Destination
Acknowledging Messages
To Run the ClientAckConsumer Client
Writing More Advanced JMS Applications
Using Durable Subscriptions
To Create Resources for the Durable Subscription Example
To Run the Durable Subscription Example
To Run the unsubscriber Example
Using Local Transactions
To Create Resources for the transactedexample Example
To Run the transactedexample Clients
Writing High Performance and Scalable JMS Applications
Using Shared Nondurable Subscriptions
Writing the Clients for the Shared Consumer Example
To Run the SharedConsumer and Producer Clients
Using Shared Durable Subscriptions
To Run the SharedDurableConsumer and Producer Clients
Sending and Receiving Messages Using a Simple Web Application
The websimplemessage Facelets Pages
The websimplemessage Managed Beans
Running the websimplemessage Example
Creating Resources for the websimplemessage Example
To Package and Deploy websimplemessage Using NetBeans IDE
To Package and Deploy websimplemessage Using Maven
To Run the websimplemessage Example
Receiving Messages Asynchronously Using a Message-Driven Bean
Overview of the simplemessage Example
The simplemessage Application Client
The simplemessage Message-Driven Bean Class
The onMessage Method
Running the simplemessage Example
Creating Resources for the simplemessage Example
To Run the simplemessage Example Using NetBeans IDE
To Run the simplemessage Example Using Maven
Sending Messages from a Session Bean to an MDB
Writing the Application Components for the clientsessionmdb Example
Coding the Application Client: MyAppClient.java
Coding the Publisher Session Bean
Coding the Message-Driven Bean: MessageBean.java
Running the clientsessionmdb Example
To Run clientsessionmdb Using NetBeans IDE
To Run clientsessionmdb Using Maven
Using an Entity to Join Messages from Two MDBs
Overview of the clientmdbentity Example Application
Writing the Application Components for the clientmdbentity Example
Coding the Application Client: HumanResourceClient.java
Coding the Message-Driven Beans for the clientmdbentity Example
Coding the Entity Class for the clientmdbentity Example
Running the clientmdbentity Example
To Run clientmdbentity Using NetBeans IDE
To Run clientmdbentity Using Maven
Viewing the Application Output
Using NetBeans IDE to Create JMS Resources
To Create JMS Resources Using NetBeans IDE
To Delete JMS Resources Using NetBeans IDE
Overview of Java EE Security
A Simple Application Security Walkthrough
Step 1: Initial Request
Step 2: Initial Authentication
Step 3: URL Authorization
Step 4: Fulfilling the Original Request
Step 5: Invoking Enterprise Bean Business Methods
Features of a Security Mechanism
Characteristics of Application Security
Security Mechanisms
Java SE Security Mechanisms
Java EE Security Mechanisms
Application-Layer Security
Transport-Layer Security
Message-Layer Security
Securing Containers
Using Annotations to Specify Security Information
Using Deployment Descriptors for Declarative Security
Using Programmatic Security
Using Pluggable Providers
JSR-196 Java Authentication Service Provider Interface for Containers (JASPIC)
JSR-375 Java EE Security API
Securing GlassFish Server
Working with Realms, Users, Groups, and Roles
What Are Realms, Users, Groups, and Roles?
What Is a Realm?
What Is a User?
What Is a Group?
What Is a Role?
Some Other Terminology
Managing Users and Groups in GlassFish Server
To Add Users to GlassFish Server
Setting Up Security Roles
Mapping Roles to Users and Groups
Working with Identity Stores
Establishing a Secure Connection Using SSL
Verifying and Configuring SSL Support
Further Information about Security
Overview of Web Application Security
Securing Web Applications
Overview of Securing Web Applications
Specifying Security Constraints
Specifying a Web Resource Collection
Specifying an Authorization Constraint
Specifying a Secure Connection
Specifying Security Constraints for Resources
Specifying Authentication Mechanisms
HTTP Basic Authentication
Form-Based Authentication
Digest Authentication
Specifying an Authentication Mechanism in the Deployment Descriptor
Declaring Security Roles
Using Programmatic Security with Web Applications
Authenticating Users Programmatically
Checking Caller Identity Programmatically
Testing Access to a Resource Programmatically
Example Code for Programmatic Security
Declaring and Linking Role References
Examples: Securing Web Applications
Overview of Examples of Securing Web Applications
To Set Up Your System for Running the Security Examples
The hello2-basicauth Example: Basic Authentication with a Servlet
Specifying Security for Basic Authentication Using Annotations
To Build, Package, and Deploy the hello2-basicauth Example Using NetBeans IDE
To Build, Package, and Deploy the hello2-basicauth Example Using Maven
To Run the hello2-basicauth Example
The hello1-formauth Example: Form-Based Authentication with a JavaServer Faces Application
Creating the Login Form and the Error Page
Specifying Security for the Form-Based Authentication Example
To Build, Package, and Deploy the hello1-formauth Example Using NetBeans IDE
To Build, Package, and Deploy the hello1-formauth Example Using Maven and the asadmin Command
To Run the hello1-formauth Example
Basic Security Tasks for Enterprise Applications
Securing Enterprise Beans
Securing an Enterprise Bean Using Declarative Security
Specifying Authorized Users by Declaring Security Roles
Specifying an Authentication Mechanism and Secure Connection
Securing an Enterprise Bean Programmatically
Propagating a Security Identity (Run-As)
Configuring a Component’s Propagated Security Identity
Trust between Containers
Deploying Secure Enterprise Beans
Examples: Securing Enterprise Beans
The cart-secure Example: Securing an Enterprise Bean with Declarative Security
Annotating the Bean
To Run the cart-secure Example Using NetBeans IDE
To Run the cart-secure Example Using Maven
The converter-secure Example: Securing an Enterprise Bean with Programmatic Security
Modifying ConverterBean
Modifying ConverterServlet
To Run the converter-secure Example Using NetBeans IDE
To Run the converter-secure Example Using Maven
To Run the converter-secure Example
About the Java EE Security API
Overview of the HTTP Authentication Mechanism Interface
Overview of the Identity Store Interfaces
Running the Built-In Database Identity Store Example
Overview of the Built-In Database Identity Store Example
Define the Users and Groups in the Identity Store
Map the DatabaseIdentityStore to the Default Data source
Specify the Authentication Mechanism
Declare Roles in the Servlet Container
Running the built-in-db-identity-store Example
To Build, Package, and Deploy the built-in-db-identity-store Example Using NetBeans IDE
To Build, Package, and Deploy the built-in-db-identity-store Example Using Maven
To Run the built-in-db-identity-store Example
Running the Custom Identity Store Example
Overview of the Custom Identity Store Example
Running the custom-identity-store Example
To Build, Package, and Deploy the custom-identity-store Example Using NetBeans IDE
To Build, Package, and Deploy the custom-identity-store Example Using Maven
To Run the custom-identity-store Example
Working with Digital Certificates
Creating a Server Certificate
To Use keytool to Create a Server Certificate
Adding Users to the Certificate Realm
Using a Different Server Certificate with GlassFish Server
To Specify a Different Server Certificate
Authentication Mechanisms
Client Authentication
Mutual Authentication
Enabling Mutual Authentication over SSL
Creating a Client Certificate for Mutual Authentication
Using the JDBC Realm for User Authentication
To Configure a JDBC Authentication Realm
Securing HTTP Resources
Securing Application Clients
Using Login Modules
Using Programmatic Login
Securing Enterprise Information Systems Applications
Overview of Securing Enterprise Information Systems Applications
Container-Managed Sign-On
Component-Managed Sign-On
Configuring Resource Adapter Security
Mapping an Application Principal to EIS Principals
Configuring Security Using Deployment Descriptors
Specifying Security for Basic Authentication in the Deployment Descriptor
Specifying Non-Default Principal-to-Role Mapping in the Deployment Descriptor
Further Information about Advanced Security Topics
Overview of Transactions
Transactions in Java EE Applications
What Is a Transaction?
Container-Managed Transactions
Transaction Attributes
Required Attribute
RequiresNew Attribute
Mandatory Attribute
NotSupported Attribute
Supports Attribute
Never Attribute
Summary of Transaction Attributes
Setting Transaction Attributes
Rolling Back a Container-Managed Transaction
Synchronizing a Session Bean’s Instance Variables
Methods Not Allowed in Container-Managed Transactions
Bean-Managed Transactions
JTA Transactions
Returning without Committing
Methods Not Allowed in Bean-Managed Transactions
Transaction Timeouts
To Set a Transaction Timeout
Updating Multiple Databases
Transactions in Web Components
Further Information about Transactions
What Is a Resource Adapter?
Management Contracts
Lifecycle Management
Work Management Contract
Generic Work Context Contract
Outbound and Inbound Contracts
Metadata Annotations
Common Client Interface
Using Resource Adapters with Contexts and Dependency Injection for Java EE (CDI)
Further Information about Resource Adapters
Overview of the Resource Adapter Examples
The trading Example
Using the Outbound Resource Adapter
Implementing the Outbound Resource Adapter
Running the trading Example
To Run the trading Example Using NetBeans IDE
To Run the trading Example Using Maven
The traffic Example
Using the Inbound Resource Adapter
Implementing the Inbound Resource Adapter
Running the traffic Example
To Run the traffic Example Using NetBeans IDE
To Run the traffic Example Using Maven
Overview of Interceptors
Interceptor Classes
Interceptor Lifecycle
Interceptors and CDI
Using Interceptors
Intercepting Method Invocations
Using Multiple Method Interceptors
Accessing Target Method Parameters from an Interceptor Class
Intercepting Lifecycle Callback Events
Using AroundConstruct Interceptor Methods
Using Multiple Lifecycle Callback Interceptors
Intercepting Timeout Events
Using Multiple Timeout Interceptors
Binding Interceptors to Components
Declaring the Interceptor Bindings on an Interceptor Class
Binding a Component to an Interceptor
Ordering Interceptors
The interceptor Example Application
Running the interceptor Example
To Run the interceptor Example Using NetBeans IDE
To Run the interceptor Example Using Maven
Introduction to Batch Processing
Steps in Batch Jobs
Parallel Processing
Status and Decision Elements
Batch Framework Functionality
Batch Processing in Java EE
The Batch Processing Framework
Creating Batch Applications
Elements of a Batch Job
Properties and Parameters
Job Instances and Job Executions
Batch and Exit Status
Simple Use Case
Chunk Step
Task Step
Using the Job Specification Language
The job Element
The step Element
The chunk Element
The batchlet Element
The partition Element
The flow Element
The split Element
The decision Element
Creating Batch Artifacts
Batch Artifact Interfaces
Dependency Injection in Batch Artifacts
Using the Context Objects from the Batch Runtime
Submitting Jobs to the Batch Runtime
Starting a Job
Checking the Status of a Job
Invoking the Batch Runtime in Your Application
Packaging Batch Applications
The webserverlog Example Application
Architecture of the webserverlog Example Application
The Job Definition File
The LogLine and LogFilteredLine Items
The Chunk Step Batch Artifacts
The Listener Batch Artifacts
The Task Step Batch Artifact
The JavaServer Faces Pages
Running the webserverlog Example Application
To Run the webserverlog Example Application Using NetBeans IDE
To Run the webserverlog Example Application Using Maven
The phonebilling Example Application
Architecture of the phonebilling Example Application
The CallRecord and PhoneBill Entities
The Call Records Chunk Step
The Phone Billing Chunk Step
Running the phonebilling Example Application
To Run the phonebilling Example Application Using NetBeans IDE
To Run the phonebilling Example Application Using Maven
Further Information about Batch Processing
Concurrency Basics
Threads and Processes
Main Components of the Concurrency Utilities
Concurrency and Transactions
Concurrency and Security
The jobs Concurrency Example
Running the jobs Example
To Configure GlassFish Server for the Basic Concurrency Example
To Build, Package, and Deploy the jobs Example Using NetBeans IDE
To Build, Package, and Deploy the jobs Example Using Maven
To Run the jobs Example and Submit Jobs with Low Priority
To Run the jobs Example and Submit Jobs with High Priority
The taskcreator Concurrency Example
Running the taskcreator Example
To Build, Package, and Deploy the taskcreator Example Using NetBeans IDE
To Build, Package, and Deploy the taskcreator Example Using Maven
To Run the taskcreator Example
Further Information about the Concurrency Utilities
Design and Architecture of Duke’s Bookstore
The Duke’s Bookstore Interface
The Book Java Persistence API Entity
Enterprise Beans Used in Duke’s Bookstore
Facelets Pages and Managed Beans Used in Duke’s Bookstore
Custom Components and Other Custom Objects Used in Duke’s Bookstore
Properties Files Used in Duke’s Bookstore
Deployment Descriptors Used in Duke’s Bookstore
Running the Duke’s Bookstore Case Study Application
To Build and Deploy Duke’s Bookstore Using NetBeans IDE
To Build and Deploy Duke’s Bookstore Using Maven
To Run Duke’s Bookstore
Design and Architecture of Duke’s Tutoring
Main Interface
Java Persistence API Entities Used in the Main Interface
Enterprise Beans Used in the Main Interface
WebSocket Endpoint Used in the Main Interface
Facelets Files Used in the Main Interface
Helper Classes Used in the Main Interface
Properties Files
Deployment Descriptors Used in Duke’s Tutoring
Administration Interface
Enterprise Beans Used in the Administration Interface
Facelets Files Used in the Administration Interface
CDI Managed Beans Used in the Administration Interface
Helper Classes Used in the Administration Interface
Running the Duke’s Tutoring Case Study Application
Running Duke’s Tutoring
To Build and Deploy Duke’s Tutoring Using NetBeans IDE
To Build and Deploy Duke’s Tutoring Using Maven
Using Duke’s Tutoring
Overview of the Duke’s Forest Case Study Example
Design and Architecture of Duke’s Forest
The events Project
The entities Project
The dukes-payment Project
The dukes-resources Project
The Duke’s Store Project
Enterprise Beans Used in Duke’s Store
Facelets Files Used in the Main Interface of Duke’s Store
Facelets Files Used in the Administration Interface of Duke’s Store
Managed Beans Used in Duke’s Store
Helper Classes Used in Duke’s Store
Qualifiers Used in Duke’s Store
Event Handlers Used in Duke’s Store
Deployment Descriptors Used in Duke’s Store
The Duke’s Shipment Project
Enterprise Beans Used in Duke’s Shipment
Facelets Files Used in Duke’s Shipment
Managed Beans Used in Duke’s Shipment
Helper Class Used in Duke’s Shipment
Qualifier Used in Duke’s Shipment
Deployment Descriptors Used in Duke’s Shipment
Building and Deploying the Duke’s Forest Case Study Application
To Build and Deploy the Duke’s Forest Application Using NetBeans IDE
To Build and Deploy the Duke’s Forest Application Using Maven
Running the Duke’s Forest Application
To Register as a Duke’s Store Customer
To Purchase Products
To Approve Shipment of a Product
To Create a New Product