About the Authors |
|
xv | |
About the Technical Reviewer |
|
xvii | |
Acknowledgments |
|
xix | |
Introduction |
|
xxi | |
CHAPTER 1 Java EE Essentials |
|
1 | (28) |
|
|
2 | (1) |
|
Flow Java EE Relates to J2SE |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (6) |
|
|
4 | (1) |
|
Client/Server (Two-Tier) Architecture |
|
|
5 | (1) |
|
|
6 | (3) |
|
|
9 | (1) |
|
|
10 | (1) |
|
Features and Concepts in Java EE |
|
|
10 | (13) |
|
Java EE Clients and Servers |
|
|
10 | (1) |
|
|
11 | (2) |
|
|
13 | (1) |
|
|
14 | (2) |
|
|
16 | (1) |
|
|
17 | (1) |
|
|
18 | (3) |
|
|
21 | (1) |
|
|
21 | (1) |
|
|
22 | (1) |
|
|
23 | (1) |
|
Sample Java EE Architectures |
|
|
23 | (3) |
|
Application Client with EJB |
|
|
23 | (1) |
|
|
24 | (1) |
|
Applet Client with JSP and Database |
|
|
25 | (1) |
|
Web Services for Application Integration |
|
|
25 | (1) |
|
|
26 | (3) |
CHAPTER 2 Getting Started |
|
29 | (14) |
|
|
29 | (3) |
|
JBoss Installation Problems and Solutions |
|
|
32 | (1) |
|
Testing the JBoss Installation |
|
|
32 | (3) |
|
|
32 | (2) |
|
JBoss Server Installation Problem and Solution |
|
|
34 | (1) |
|
Compiling and Deploying a JSP Page |
|
|
35 | (6) |
|
Creating the Example Application |
|
|
35 | (3) |
|
|
38 | (3) |
|
Application Creation Problems and Solutions |
|
|
41 | (1) |
|
|
41 | (2) |
CHAPTER 3 JavaServer Pages |
|
43 | (64) |
|
|
43 | (2) |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
45 | (10) |
|
|
46 | (2) |
|
|
48 | (2) |
|
|
50 | (5) |
|
Comments and Template Data |
|
|
55 | (1) |
|
Creating and Deploying a JSP Web Application |
|
|
55 | (17) |
|
Writing the JSP Web Application |
|
|
55 | (4) |
|
Deploying the Web Application in Java EE |
|
|
59 | (5) |
|
Deploying the Web Application in Tomcat |
|
|
64 | (4) |
|
Handling Translation or Compilation Problems |
|
|
68 | (3) |
|
Handling JSP Initialization and End of Life |
|
|
71 | (1) |
|
|
71 | (1) |
|
|
72 | (13) |
|
|
73 | (1) |
|
|
74 | (1) |
|
|
74 | (1) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
|
76 | (1) |
|
Using Standard Actions and Implicit Objects in JSP Pages |
|
|
76 | (9) |
|
Translation and Compilation |
|
|
85 | (3) |
|
Handling Errors and Exceptions |
|
|
88 | (10) |
|
Dealing with Exceptions through the page Directive |
|
|
88 | (1) |
|
Dealing with Exceptions in the Deployment Descriptor |
|
|
89 | (1) |
|
Adding Exception Handling in JSP Pages |
|
|
89 | (9) |
|
Including and Forwarding from JSP Pages |
|
|
98 | (6) |
|
|
98 | (1) |
|
|
99 | (1) |
|
Adding include and forward Actions to JSP Pages |
|
|
100 | (4) |
|
|
104 | (1) |
|
|
105 | (2) |
CHAPTER 4 Advanced JSP Topics |
|
107 | (60) |
|
|
107 | (19) |
|
|
108 | (2) |
|
|
110 | (6) |
|
Errors and Default Values in EL Statements |
|
|
116 | (1) |
|
|
117 | (9) |
|
Custom Actions and Tag Handlers |
|
|
126 | (30) |
|
|
127 | (2) |
|
|
129 | (11) |
|
|
140 | (15) |
|
A Multitude of Custom Actions |
|
|
155 | (1) |
|
JSP Standard Tag Library (JSTL) |
|
|
156 | (9) |
|
Getting a JSTL Implementation |
|
|
156 | (1) |
|
|
156 | (3) |
|
|
159 | (6) |
|
|
165 | (1) |
|
|
166 | (1) |
CHAPTER 5 JavaServer Faces |
|
167 | (62) |
|
|
167 | (4) |
|
The Relationship Between JSF and Other Java EE Technologies |
|
|
168 | (1) |
|
Request Processing Lifecycle |
|
|
169 | (2) |
|
|
171 | (1) |
|
|
172 | (12) |
|
Creating a Simple JSF Application |
|
|
173 | (11) |
|
Reviewing the JSF Lifecycle for the Sample Application |
|
|
184 | (1) |
|
|
184 | (18) |
|
Configuring Managed Beans |
|
|
185 | (4) |
|
Using Value Binding Expressions in JSP Pages |
|
|
189 | (2) |
|
Using Method Binding Expressions in JSP Pages |
|
|
191 | (1) |
|
Expanding the JSF Sample Application |
|
|
192 | (10) |
|
Controlling Page Navigation |
|
|
202 | (10) |
|
Static and Dynamic Navigation |
|
|
202 | (1) |
|
|
203 | (1) |
|
Adding Dynamic Navigation to the Sample JSF Application |
|
|
204 | (8) |
|
Accessing Context Data in Beans |
|
|
212 | (2) |
|
|
214 | (7) |
|
Using Standard Converters |
|
|
215 | (1) |
|
|
216 | (5) |
|
|
221 | (3) |
|
Using Standard Validators |
|
|
221 | (1) |
|
|
222 | (2) |
|
|
224 | (1) |
|
|
224 | (3) |
|
|
227 | (1) |
|
|
228 | (1) |
CHAPTER 6 Servlets |
|
229 | (80) |
|
|
230 | (4) |
|
|
230 | (4) |
|
How a Server Responds to Requests |
|
|
234 | (1) |
|
The Servlet Model and HttpServlets |
|
|
234 | (32) |
|
|
235 | (3) |
|
A Servlet That Responds to POST Requests |
|
|
238 | (9) |
|
|
247 | (3) |
|
|
250 | (1) |
|
|
250 | (4) |
|
|
254 | (4) |
|
Event Logging in Servlets |
|
|
258 | (1) |
|
Multithreading in Servlets |
|
|
258 | (8) |
|
|
266 | (4) |
|
Problems with Exception Handling |
|
|
266 | (3) |
|
|
269 | (1) |
|
|
270 | (10) |
|
Creating and Using Sessions |
|
|
271 | (8) |
|
Using Cookies in Place of Sessions |
|
|
279 | (1) |
|
|
280 | (11) |
|
Implementing the Filter Interface |
|
|
281 | (1) |
|
Modifying the Deployment Descriptor to Use a Filter |
|
|
282 | (9) |
|
|
291 | (15) |
|
|
291 | (1) |
|
|
292 | (1) |
|
|
293 | (2) |
|
Creating an MVC Application |
|
|
295 | (11) |
|
|
306 | (1) |
|
|
307 | (2) |
CHAPTER 7 Working with Databases |
|
309 | (48) |
|
|
310 | (20) |
|
Using Data Sources for Connections |
|
|
311 | (1) |
|
Configuring a DataSource and Connection with Java EE |
|
|
311 | (10) |
|
Configuring a DataSource and Connection with Tomcat |
|
|
321 | (7) |
|
|
328 | (2) |
|
Setting the Login Timeout |
|
|
330 | (1) |
|
|
330 | (2) |
|
Logging with a DataSource |
|
|
332 | (1) |
|
Creating and Using Statement Objects |
|
|
333 | (11) |
|
Executing Single Statements |
|
|
334 | (1) |
|
|
334 | (1) |
|
|
335 | (1) |
|
Using Statements to Insert Data into a Database |
|
|
336 | (8) |
|
Using the ResultSet Class |
|
|
344 | (10) |
|
Moving Through the ResultSet |
|
|
344 | (3) |
|
Reading Data from Resultsets |
|
|
347 | (4) |
|
|
351 | (1) |
|
Using Updatable Resultsets |
|
|
351 | (2) |
|
Keeping the ResultSet Open: ResultSet Holdability |
|
|
353 | (1) |
|
|
354 | (1) |
|
|
354 | (3) |
CHAPTER 8 Advanced Topics in JDBC |
|
357 | (48) |
|
|
357 | (14) |
|
Reasons for Using Prepared Statements |
|
|
358 | (4) |
|
Creating a PreparedStatement |
|
|
362 | (1) |
|
Using a Prepared Statement |
|
|
363 | (8) |
|
|
371 | (5) |
|
Reasons for Using Stored Procedures |
|
|
371 | (1) |
|
Creating a CallableStatement |
|
|
372 | (3) |
|
Calling a Stored Procedure |
|
|
375 | (1) |
|
|
376 | (14) |
|
|
376 | (1) |
|
|
377 | (8) |
|
Using Transactions with Stored Procedures |
|
|
385 | (1) |
|
Using Distributed Transactions |
|
|
386 | (4) |
|
|
390 | (12) |
|
|
391 | (1) |
|
Using Pessimistic and Optimistic Locking |
|
|
392 | (10) |
|
|
402 | (1) |
|
|
403 | (2) |
CHAPTER 9 EJB Fundamentals and Session Beans |
|
405 | (20) |
|
|
405 | (6) |
|
|
406 | (1) |
|
|
407 | (1) |
|
|
407 | (3) |
|
Which Type of EJB Should You Use? |
|
|
410 | (1) |
|
The Anatomy of a Session Bean |
|
|
411 | (1) |
|
|
412 | (12) |
|
Using a Stateless Session Bean |
|
|
412 | (6) |
|
Choosing Between Stateful and Stateless Session Beans |
|
|
418 | (1) |
|
Using a Stateful Session Bean |
|
|
419 | (5) |
|
|
424 | (1) |
|
|
424 | (1) |
CHAPTER 10 EJB Entity Beans |
|
425 | (48) |
|
How Entity Beans Work with Session Beans |
|
|
425 | (1) |
|
The Anatomy of an Entity Bean |
|
|
426 | (5) |
|
|
427 | (1) |
|
Container-Managed Persistence and the EntityManager Interface |
|
|
428 | (2) |
|
|
430 | (1) |
|
|
430 | (1) |
|
Developing CMP Entity Beans |
|
|
431 | (10) |
|
Building the CMP Entity Bean Application |
|
|
431 | (7) |
|
Compiling the CMP Entity Bean Application |
|
|
438 | (1) |
|
Deploying the CMP Entity Bean Application |
|
|
439 | (1) |
|
Running the CMP Entity Bean Application |
|
|
439 | (1) |
|
Reviewing the CMP Entity Bean |
|
|
440 | (1) |
|
Reviewing the Session Bean |
|
|
440 | (1) |
|
Developing BMP Entity Beans |
|
|
441 | (23) |
|
Building the BMP Entity Bean Application |
|
|
442 | (16) |
|
Deploying the BMP Entity Bean Application |
|
|
458 | (1) |
|
Running the BMP Entity Bean Application |
|
|
459 | (1) |
|
Reviewing the BMP Entity Bean |
|
|
459 | (5) |
|
|
464 | (7) |
|
|
465 | (1) |
|
Building and Deploying the EJB QL Queries Application |
|
|
466 | (3) |
|
Running the EJB QL Queries Application |
|
|
469 | (1) |
|
Reviewing the Session Bean Find Methods |
|
|
470 | (1) |
|
|
471 | (1) |
|
|
471 | (2) |
CHAPTER 11 EJB Relationships, EJB QL, and JDBC |
|
473 | (32) |
|
Entity Bean Relationships |
|
|
473 | (5) |
|
One-to-Many and Many-to-One Relationships |
|
|
474 | (2) |
|
Many-to-Many Relationships |
|
|
476 | (1) |
|
An EJB QL Query to Acquire a Subset of Data |
|
|
477 | (1) |
|
Container-Managed Relationships and EJB QL |
|
|
478 | (18) |
|
Building the Application with CMR |
|
|
480 | (11) |
|
Compiling the CMR Application |
|
|
491 | (1) |
|
Deploying the CMR Application |
|
|
492 | (1) |
|
|
492 | (1) |
|
Running the CMR Application |
|
|
492 | (1) |
|
Reviewing the CMR Application |
|
|
493 | (3) |
|
JDBC with EJB Entity Beans |
|
|
496 | (7) |
|
Implementing JDBC with EJB Applications |
|
|
497 | (2) |
|
Using JDBC with the StockList Bean |
|
|
499 | (4) |
|
|
503 | (1) |
|
|
503 | (2) |
CHAPTER 12 Design Patterns and EJB |
|
505 | (38) |
|
|
505 | (1) |
|
|
506 | (26) |
|
Building the Application with Design Patterns |
|
|
508 | (19) |
|
Compiling and Running the Application with Design Patterns |
|
|
527 | (2) |
|
Reviewing the Application's Design Patterns |
|
|
529 | (3) |
|
Using JSP and Servlets with EJBs |
|
|
532 | (9) |
|
Building the Modified JSP/Servlets Client |
|
|
532 | (8) |
|
Reviewing the Modified JSP/Servlets Client |
|
|
540 | (1) |
|
|
541 | (1) |
|
|
541 | (2) |
CHAPTER 13 Message-Driven Beans |
|
543 | (18) |
|
Message-Driven Beans Overview |
|
|
543 | (5) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
546 | (1) |
|
Invocation of an Interceptor |
|
|
547 | (1) |
|
|
548 | (1) |
|
|
549 | (1) |
|
Using MDBs, JMS, and the EJB Timer Service: Putting It All Together |
|
|
550 | (9) |
|
Creating the MessageTimerApp Example |
|
|
551 | (3) |
|
Building and Running MessageTimerApp |
|
|
554 | (1) |
|
Reviewing MessageTimerApp |
|
|
555 | (4) |
|
|
559 | (1) |
|
|
559 | (1) |
|
|
560 | (1) |
CHAPTER 14 Web Services and JAX-WS |
|
561 | (20) |
|
Understanding Web Services |
|
|
562 | (5) |
|
Web Services Standards and Models |
|
|
563 | (2) |
|
|
565 | (1) |
|
Web Services Protocol Stack |
|
|
565 | (2) |
|
Developing a Web Service in Java |
|
|
567 | (11) |
|
|
568 | (1) |
|
|
569 | (1) |
|
|
570 | (6) |
|
Building, Testing, and Serving the Web Service |
|
|
576 | (2) |
|
|
578 | (1) |
|
|
579 | (2) |
APPENDIX A Tomcat: Who Needs Java EE 5? |
|
581 | (4) |
|
Obtaining and Installing Tomcat |
|
|
581 | (3) |
|
Binary Installation to Windows |
|
|
582 | (1) |
|
Binary Installation to Linux/Unix |
|
|
583 | (1) |
|
|
584 | (1) |
APPENDIX B SQL and EJB QL |
|
585 | (22) |
|
|
585 | (15) |
|
|
585 | (2) |
|
|
587 | (1) |
|
|
588 | (3) |
|
Selecting Data from Tables |
|
|
591 | (6) |
|
|
597 | (2) |
|
|
599 | (1) |
|
|
600 | (7) |
|
|
601 | (1) |
|
The javax.ejb.Query Object |
|
|
601 | (1) |
|
|
602 | (3) |
|
|
605 | (2) |
APPENDIX C Java EE Glossary |
|
607 | (8) |
INDEX |
|
615 | |