Author(s): Eric Jendrock
Edition: 4th ed
Publisher:
Language: English
Pages: 556
Contents......Page 3
Part I: Introduction......Page 19
1 Overview......Page 20
Java EE 6 PlatformHighlights......Page 21
Java EE ApplicationModel......Page 22
DistributedMultitiered Applications......Page 23
Java EE Containers......Page 30
Web Services Support......Page 32
Packaging Applications......Page 34
Development Roles......Page 36
Java EE 6 APIs......Page 39
Java EE 6 APIs in the Java Platform, Standard Edition 6.0......Page 48
GlassFish Server Tools......Page 51
Required Software......Page 53
Starting and Stopping the GlassFish Server......Page 57
Starting the Administration Console......Page 58
Starting and Stopping the Java DB Server......Page 59
Getting the Latest Updates to the Tutorial......Page 60
Debugging Java EE Applications......Page 61
Part II: The WebTier......Page 63
3 Getting Started withWeb Applications......Page 64
Web Applications......Page 65
Web Application Lifecycle......Page 66
WebModules: The hello1 Example......Page 68
Configuring Web Applications: The hello2 Example......Page 77
Further Information about Web Applications......Page 86
4 JavaServer FacesTechnology......Page 87
What Is a JavaServer Faces Application?......Page 88
JavaServer Faces Technology Benefits......Page 89
Creating a Simple JavaServer Faces Application......Page 91
Further Information about JavaServer Faces Technology......Page 95
What Is Facelets?......Page 96
Developing a Simple Facelets Application......Page 98
Templating......Page 104
Composite Components......Page 107
Resources......Page 109
Overview of the EL......Page 111
Immediate and Deferred Evaluation Syntax......Page 112
Value and Method Expressions......Page 114
Setting Up a Page......Page 125
Adding Components to a Page Using HTML Tags......Page 126
Using Core Tags......Page 155
Using the Standard Converters......Page 157
Registering Listeners on Components......Page 163
Using the Standard Validators......Page 164
Referencing a Backing Bean Method......Page 166
Backing Beans......Page 170
Writing Bean Properties......Page 173
Writing Backing Bean Methods......Page 181
Using Bean Validation......Page 185
10 Java Servlet Technology......Page 190
Servlet Lifecycle......Page 191
Sharing Information......Page 193
Creating and Initializing a Servlet......Page 194
Writing Service Methods......Page 195
Filtering Requests and Responses......Page 198
Invoking Other Web Resources......Page 202
Maintaining Client State......Page 204
Finalizing a Servlet......Page 206
The mood Example Application......Page 209
Further Information about Java Servlet Technology......Page 211
Part III: Web Services......Page 212
Types of Web Services......Page 213
Deciding Which Type of Web Service to Use......Page 216
12 Building Web Services with JAX-WS......Page 217
Creating a Simple Web Service and Clients with JAX-WS......Page 218
Further Information about JAX-WS......Page 227
What Are RESTful Web Services?......Page 228
Creating a RESTful Root Resource Class......Page 229
Example Applications for JAX-RS......Page 244
Further Information about JAX-RS......Page 249
Part IV: Enterprise Beans......Page 251
What Is an Enterprise Bean?......Page 252
What Is a Session Bean?......Page 254
What Is a Message-Driven Bean?......Page 256
Accessing Enterprise Beans......Page 258
The Contents of an Enterprise Bean......Page 265
Naming Conventions for Enterprise Beans......Page 267
The Lifecycles of Enterprise Beans......Page 268
Further Information about Enterprise Beans......Page 271
Creating the Enterprise Bean......Page 272
Modifying the Java EE Application......Page 276
The cart Example......Page 278
A Singleton Session Bean Example: counter......Page 285
A Web Service Example: helloservice......Page 293
Using the Timer Service......Page 297
Handling Exceptions......Page 307
Part V: Contexts and Dependency Injection for the Java EE Platform......Page 309
17 Introduction to Contexts and Dependency Injection for the Java EE Platform......Page 310
Overview of CDI......Page 311
About Managed Beans......Page 312
Beans as Injectable Objects......Page 313
Using Qualifiers......Page 314
Using Scopes......Page 315
Adding Setter and Getter Methods......Page 317
Using a Managed Bean in a Facelets Page......Page 318
Injecting Objects by Using ProducerMethods......Page 319
Further Information about CDI......Page 320
The simplegreeting CDI Example......Page 321
The guessnumber CDI Example......Page 326
Part VI: Persistence......Page 335
Entities......Page 336
Entity Inheritance......Page 348
Managing Entities......Page 352
Further Information about Persistence......Page 358
The order Application......Page 360
The roster Application......Page 372
The address-book Application......Page 379
21 The Java Persistence Query Language......Page 384
Creating Queries Using the Java Persistence Query Language......Page 385
Simplified Query Language Syntax......Page 387
Example Queries......Page 388
Full Query Language Syntax......Page 393
Overview of the Criteria and Metamodel APIs......Page 417
Using the Metamodel API to Model Entity Classes......Page 419
Using the Criteria API and Metamodel API to Create Basic Typesafe Queries......Page 420
Part VII: Security......Page 429
23 Introduction to Security in the Java EE Platform......Page 430
Overview of Java EE Security......Page 431
SecurityMechanisms......Page 436
Securing Containers......Page 440
Securing the GlassFish Server......Page 441
Working with Realms, Users, Groups, and Roles......Page 442
Establishing a Secure Connection Using SSL......Page 450
Further Information about Security......Page 455
Overview of Web Application Security......Page 456
Securing Web Applications......Page 458
Using Programmatic Security with Web Applications......Page 470
Examples: Securing Web Applications......Page 475
25 Getting Started Securing Enterprise Applications......Page 486
Securing Enterprise Beans......Page 487
Examples: Securing Enterprise Beans......Page 497
Securing Application Clients......Page 505
Securing Enterprise Information Systems Applications......Page 507
Part VIII: Java EE SupportingTechnologies......Page 511
Transactions......Page 512
Resources......Page 513
What Is a Transaction?......Page 515
Container-Managed Transactions......Page 516
Bean-Managed Transactions......Page 522
Transaction Timeouts......Page 523
UpdatingMultipleDatabases......Page 524
Further Information about Transactions......Page 526
Resources and JNDINaming......Page 527
DataSource Objects and Connection Pools......Page 528
Resource Injection......Page 529
Resource Adapters and Contracts......Page 532
Metadata Annotations......Page 536
Common Client Interface......Page 538
Further Information about Resources......Page 539
Numbers and Symbols......Page 540
B......Page 541
C......Page 542
E......Page 544
G......Page 546
J......Page 547
M......Page 549
P......Page 550
Q......Page 551
S......Page 552
T......Page 554
W......Page 555
X......Page 556