About the Author |
|
xxxix | |
About the Technical Reviewer |
|
xli | |
Acknowledgments |
|
xliii | |
Introduction |
|
xlv | |
Chapter 1 Working with Servlets |
|
1 | (58) |
|
1.1 Setting Up a Java Enterprise Environment |
|
|
2 | (2) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
4 | (5) |
|
|
4 | (1) |
|
|
4 | (3) |
|
|
7 | (2) |
|
1.3 Packaging, Compiling, and Deploying a Servlet |
|
|
9 | (2) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
10 | (1) |
|
1.4 Registering Servlets Without WEB-XML |
|
|
11 | (3) |
|
|
11 | (1) |
|
|
11 | (2) |
|
|
13 | (1) |
|
1.5 Displaying Dynamic Content with a Servlet |
|
|
14 | (3) |
|
|
14 | (1) |
|
|
14 | (2) |
|
|
16 | (1) |
|
1.6 Handling Requests and Responses |
|
|
17 | (3) |
|
|
17 | (1) |
|
|
17 | (2) |
|
|
19 | (1) |
|
1.7 Listening for Servlet Container Events |
|
|
20 | (3) |
|
|
20 | (1) |
|
|
20 | (2) |
|
|
22 | (1) |
|
1.8 Setting Initialization Parameters |
|
|
23 | (2) |
|
|
23 | (1) |
|
|
23 | (1) |
|
|
24 | (1) |
|
|
24 | (1) |
|
1.9 Filtering Web Requests |
|
|
25 | (2) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
1.10 Listening for Attribute Changes |
|
|
27 | (3) |
|
|
27 | (1) |
|
|
27 | (2) |
|
|
29 | (1) |
|
1.11 Applying a Listener to a Session |
|
|
30 | (2) |
|
|
30 | (1) |
|
|
30 | (1) |
|
|
31 | (1) |
|
1.12 Managing Session Attributes |
|
|
32 | (2) |
|
|
32 | (1) |
|
|
32 | (2) |
|
|
34 | (1) |
|
|
34 | (4) |
|
|
34 | (1) |
|
|
34 | (3) |
|
|
37 | (1) |
|
1.14 Dispatching Requests |
|
|
38 | (5) |
|
|
38 | (1) |
|
|
38 | (4) |
|
|
42 | (1) |
|
1.15 Redirecting to a Different Site |
|
|
43 | (1) |
|
|
43 | (1) |
|
|
43 | (1) |
|
|
43 | (1) |
|
1.16 Securely Maintaining State Within the Browser |
|
|
44 | (4) |
|
|
44 | (1) |
|
|
44 | (3) |
|
|
47 | (1) |
|
1.17 Finalizing Servlet Tasks |
|
|
48 | (1) |
|
|
48 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
1.18 Reading and Writing with Nonblocking I/O |
|
|
49 | (7) |
|
|
49 | (1) |
|
|
49 | (5) |
|
|
54 | (2) |
|
1.19 Pushing Resources from a Server to a Client |
|
|
56 | (3) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
57 | (2) |
Chapter 2 JavaServer Pages |
|
59 | (44) |
|
2.1 Creating a Simple JSP Page |
|
|
60 | (2) |
|
|
60 | (1) |
|
|
60 | (1) |
|
|
61 | (1) |
|
2.2 Embedding Java into a JSP Page |
|
|
62 | (2) |
|
|
62 | (1) |
|
|
62 | (1) |
|
|
63 | (1) |
|
2.3 Separating Business Logic from View Code |
|
|
64 | (3) |
|
|
64 | (1) |
|
|
64 | (2) |
|
|
66 | (1) |
|
2.4 Yielding or Setting Values |
|
|
67 | (3) |
|
|
67 | (1) |
|
|
67 | (1) |
|
|
68 | (2) |
|
2.5 Invoking a Function in a Conditional Expression |
|
|
70 | (4) |
|
|
70 | (1) |
|
|
70 | (2) |
|
|
72 | (2) |
|
2.6 Creating a JSP Document |
|
|
74 | (2) |
|
|
74 | (1) |
|
|
74 | (1) |
|
|
75 | (1) |
|
2.7 Embedding Expressions in EL |
|
|
76 | (5) |
|
|
76 | (1) |
|
|
76 | (2) |
|
|
78 | (3) |
|
2.8 Accessing Parameters in Multiple Pages |
|
|
81 | (2) |
|
|
81 | (1) |
|
|
81 | (1) |
|
|
82 | (1) |
|
2.9 Creating a Custom JSP Tag |
|
|
83 | (4) |
|
|
83 | (1) |
|
|
83 | (3) |
|
|
86 | (1) |
|
2.10 Including Other JSPs into a Page |
|
|
87 | (2) |
|
|
87 | (1) |
|
|
87 | (1) |
|
|
88 | (1) |
|
2.11 Creating an Input Form for a Database Record |
|
|
89 | (5) |
|
|
89 | (1) |
|
|
89 | (3) |
|
|
92 | (2) |
|
2.12 Looping Through Database Records Within a Page |
|
|
94 | (4) |
|
|
94 | (1) |
|
|
94 | (3) |
|
|
97 | (1) |
|
|
98 | (2) |
|
|
98 | (1) |
|
|
98 | (1) |
|
|
99 | (1) |
|
2.14 Disabling Scriptlets in Pages |
|
|
100 | (1) |
|
|
100 | (1) |
|
|
100 | (1) |
|
|
101 | (1) |
|
2.15 Ignoring EL in Pages |
|
|
101 | (2) |
|
|
101 | (1) |
|
|
101 | (1) |
|
|
101 | (1) |
|
|
101 | (1) |
|
|
102 | (1) |
Chapter 3 The Basics of JavaServer Faces |
|
103 | (88) |
|
3.1 Writing a Simple JSF Application |
|
|
104 | (6) |
|
|
104 | (1) |
|
|
104 | (3) |
|
|
107 | (1) |
|
|
108 | (2) |
|
3.2 Writing a Controller Class |
|
|
110 | (7) |
|
|
110 | (1) |
|
|
110 | (5) |
|
|
115 | (2) |
|
3.3 Building Sophisticated JSF Views with Components |
|
|
117 | (8) |
|
|
117 | (1) |
|
|
117 | (6) |
|
|
123 | (2) |
|
3.4 Displaying Messages in JSF Pages |
|
|
125 | (4) |
|
|
125 | (1) |
|
|
125 | (2) |
|
|
127 | (2) |
|
3.5 Updating Messages Without Recompiling |
|
|
129 | (2) |
|
|
129 | (1) |
|
|
129 | (2) |
|
|
131 | (1) |
|
3.6 Navigating Based Upon Conditions |
|
|
131 | (7) |
|
|
131 | (1) |
|
|
131 | (5) |
|
|
136 | (2) |
|
3.7 Validating User Input |
|
|
138 | (6) |
|
|
138 | (1) |
|
|
138 | (4) |
|
|
142 | (2) |
|
3.8 Evaluating Page Expressions Immediately |
|
|
144 | (2) |
|
|
144 | (1) |
|
|
144 | (2) |
|
|
146 | (1) |
|
3.9 Passing Page Parameters to Methods |
|
|
146 | (4) |
|
|
146 | (1) |
|
|
146 | (4) |
|
|
150 | (1) |
|
3.10 Using Operators and Reserved Words in Expressions |
|
|
150 | (4) |
|
|
150 | (1) |
|
|
150 | (2) |
|
|
152 | (2) |
|
3.11 Creating Bookmarkable URLs |
|
|
154 | (2) |
|
|
154 | (1) |
|
|
154 | (1) |
|
|
155 | (1) |
|
3.12 Displaying Lists of Objects |
|
|
156 | (5) |
|
|
156 | (1) |
|
|
156 | (4) |
|
|
160 | (1) |
|
3.13 Developing with HTML5 |
|
|
161 | (2) |
|
|
161 | (1) |
|
|
161 | (1) |
|
|
162 | (1) |
|
3.14 Creating Page Templates |
|
|
163 | (5) |
|
|
163 | (1) |
|
|
163 | (1) |
|
|
164 | (4) |
|
|
168 | (9) |
|
|
168 | (1) |
|
|
168 | (7) |
|
|
175 | (2) |
|
3.16 Adding Resources into the Mix |
|
|
177 | (4) |
|
|
177 | (1) |
|
|
178 | (2) |
|
|
180 | (1) |
|
3.17 Handling Variable-Length Data |
|
|
181 | (7) |
|
|
181 | (1) |
|
|
181 | (2) |
|
|
183 | (5) |
|
3.18 Invoking Controller Class Actions on Lifecycle Phase Events |
|
|
188 | (3) |
|
|
188 | (1) |
|
|
188 | (1) |
|
|
188 | (3) |
Chapter 4 JavaServer Faces Standard Components |
|
191 | (52) |
|
|
191 | (5) |
|
Common Component Tag Attributes |
|
|
194 | (1) |
|
Common JavaScript Component Tags |
|
|
194 | (1) |
|
Binding Components to Properties |
|
|
195 | (1) |
|
4.1 Creating an Input Form |
|
|
196 | (5) |
|
|
196 | (1) |
|
|
196 | (3) |
|
|
199 | (2) |
|
4.2 Invoking Actions from Within a Page |
|
|
201 | (5) |
|
|
201 | (1) |
|
|
201 | (3) |
|
|
204 | (2) |
|
|
206 | (7) |
|
|
206 | (1) |
|
|
206 | (3) |
|
|
209 | (4) |
|
4.4 Adding Form Validation |
|
|
213 | (6) |
|
|
213 | (1) |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
214 | (2) |
|
|
216 | (3) |
|
4.5 Adding Select Lists to Pages |
|
|
219 | (4) |
|
|
219 | (1) |
|
|
219 | (2) |
|
|
221 | (2) |
|
4.6 Adding Graphics to Your Pages |
|
|
223 | (1) |
|
|
223 | (1) |
|
|
223 | (1) |
|
|
223 | (1) |
|
4.7 Adding Check Boxes to a View |
|
|
224 | (5) |
|
|
224 | (1) |
|
|
224 | (3) |
|
|
227 | (2) |
|
4.8 Adding Radio Buttons to a View |
|
|
229 | (2) |
|
|
229 | (1) |
|
|
229 | (1) |
|
|
230 | (1) |
|
4.9 Displaying a Collection of Data |
|
|
231 | (8) |
|
|
231 | (1) |
|
|
231 | (5) |
|
|
236 | (3) |
|
4.10 Utilizing Custom JSF Component Libraries |
|
|
239 | (1) |
|
|
239 | (1) |
|
|
239 | (1) |
|
|
239 | (1) |
|
4.11 Implementing File Uploading |
|
|
240 | (3) |
|
|
240 | (1) |
|
|
240 | (1) |
|
|
240 | (3) |
Chapter 5 Advanced JavaServer Faces and Ajax |
|
243 | (70) |
|
5.1 Validating Input with Ajax |
|
|
244 | (7) |
|
|
244 | (1) |
|
|
244 | (4) |
|
|
248 | (3) |
|
5.2 Submitting Pages Without Page Reloads |
|
|
251 | (1) |
|
|
251 | (1) |
|
|
251 | (1) |
|
|
251 | (1) |
|
5.3 Making Partial-Page Updates |
|
|
252 | (1) |
|
|
252 | (1) |
|
|
252 | (1) |
|
|
253 | (1) |
|
5.4 Applying Ajax Functionality to a Group of Components |
|
|
253 | (5) |
|
|
253 | (1) |
|
|
253 | (4) |
|
|
257 | (1) |
|
5.5 Custom Processing of Ajax Functionality |
|
|
258 | (2) |
|
|
258 | (1) |
|
|
258 | (2) |
|
|
260 | (1) |
|
5.6 Custom Conversion of Input Values |
|
|
260 | (4) |
|
|
260 | (1) |
|
|
261 | (1) |
|
|
262 | (2) |
|
5.7 Maintaining Managed Bean Scopes for a Session |
|
|
264 | (10) |
|
|
264 | (1) |
|
|
264 | (9) |
|
|
273 | (1) |
|
5.8 Listening for System-Level Events |
|
|
274 | (2) |
|
|
274 | (1) |
|
|
274 | (2) |
|
|
276 | (1) |
|
5.9 Listening for Component Events |
|
|
276 | (2) |
|
|
276 | (1) |
|
|
276 | (1) |
|
|
277 | (1) |
|
5.10 Invoking a Managed Bean Action on Render |
|
|
278 | (2) |
|
|
278 | (1) |
|
|
278 | (1) |
|
|
279 | (1) |
|
5.11 Asynchronously Updating Components |
|
|
280 | (3) |
|
|
280 | (1) |
|
|
280 | (3) |
|
|
283 | (1) |
|
5.12 Developing JSF Components Containing HTML5 |
|
|
283 | (3) |
|
|
283 | (1) |
|
|
283 | (2) |
|
|
285 | (1) |
|
5.13 Listening to JSF Phases |
|
|
286 | (2) |
|
|
286 | (1) |
|
|
286 | (2) |
|
|
288 | (1) |
|
5.14 Adding Auto-Completion to Text Fields |
|
|
288 | (3) |
|
|
288 | (1) |
|
|
288 | (2) |
|
|
290 | (1) |
|
5.15 Developing Custom Constraint Annotations |
|
|
291 | (4) |
|
|
291 | (1) |
|
|
291 | (2) |
|
|
293 | (2) |
|
5.16 Developing a Page Flow |
|
|
295 | (6) |
|
|
295 | (1) |
|
|
295 | (3) |
|
|
298 | (3) |
|
5.17 Constructing a JSF View in Pure HTML5 |
|
|
301 | (1) |
|
|
301 | (1) |
|
|
301 | (1) |
|
|
302 | (1) |
|
5.18 Invoking Server-Side Methods via Ajax |
|
|
302 | (3) |
|
|
302 | (1) |
|
|
303 | (2) |
|
|
305 | (1) |
|
5.19 Broadcasting Messages from the Server to All Clients |
|
|
305 | (3) |
|
|
305 | (1) |
|
|
306 | (1) |
|
|
307 | (1) |
|
5.20 Programmatically Searching for Components |
|
|
308 | (5) |
|
|
308 | (1) |
|
|
308 | (1) |
|
|
309 | (1) |
|
|
310 | (3) |
Chapter 6 The MVC Framework |
|
313 | (32) |
|
6.1 Configuring an Application for the MVC Framework |
|
|
314 | (3) |
|
|
314 | (1) |
|
|
314 | (2) |
|
|
316 | (1) |
|
6.2 Making Data Available for the Application |
|
|
317 | (10) |
|
|
317 | (1) |
|
|
317 | (4) |
|
|
321 | (5) |
|
|
326 | (1) |
|
6.3 Writing a Controller Class |
|
|
327 | (3) |
|
|
327 | (1) |
|
|
327 | (1) |
|
|
328 | (2) |
|
6.4 Using a Model to Expose Data to a View |
|
|
330 | (2) |
|
|
330 | (1) |
|
|
330 | (2) |
|
|
332 | (1) |
|
6.5 Utilizing CDI for Exposing Data |
|
|
332 | (3) |
|
|
332 | (1) |
|
|
332 | (2) |
|
|
334 | (1) |
|
6.6 Supplying Message Feedback to the User |
|
|
335 | (3) |
|
|
335 | (1) |
|
|
335 | (2) |
|
|
337 | (1) |
|
6.7 Inserting and Updating Data |
|
|
338 | (2) |
|
|
338 | (1) |
|
|
338 | (1) |
|
|
339 | (1) |
|
6.8 Applying a Different View Engine |
|
|
340 | (5) |
|
|
340 | (1) |
|
|
341 | (1) |
|
|
341 | (2) |
|
|
343 | (2) |
Chapter 7 JDBC |
|
345 | (50) |
|
7.1 Obtaining Database Drivers and Adding Them to the CLASSPATH |
|
|
346 | (1) |
|
|
346 | (1) |
|
|
346 | (1) |
|
|
346 | (1) |
|
7.2 Connecting to a Database |
|
|
347 | (5) |
|
|
347 | (1) |
|
|
347 | (1) |
|
|
348 | (3) |
|
|
351 | (1) |
|
7.3 Handling Database Connection Exceptions |
|
|
352 | (1) |
|
|
352 | (1) |
|
|
353 | (1) |
|
|
353 | (1) |
|
7.4 Simplifying Connection Management |
|
|
353 | (5) |
|
|
353 | (1) |
|
|
354 | (3) |
|
|
357 | (1) |
|
|
358 | (2) |
|
|
358 | (1) |
|
|
358 | (1) |
|
|
359 | (1) |
|
7.6 Performing CRUD Operations |
|
|
360 | (3) |
|
|
360 | (1) |
|
|
360 | (2) |
|
|
362 | (1) |
|
7.7 Preventing SQL Injection |
|
|
363 | (7) |
|
|
363 | (1) |
|
|
364 | (3) |
|
|
367 | (3) |
|
7.8 Utilizing Java Objects for Database Access |
|
|
370 | (6) |
|
|
370 | (1) |
|
|
370 | (6) |
|
|
376 | (1) |
|
7.9 Navigating Data with Scrollable ResultSets |
|
|
376 | (3) |
|
|
376 | (1) |
|
|
377 | (1) |
|
|
378 | (1) |
|
7.10 Calling PL/SQL Stored Procedures |
|
|
379 | (1) |
|
|
379 | (1) |
|
|
379 | (1) |
|
|
380 | (1) |
|
7.11 Querying and Storing Large Objects |
|
|
380 | (4) |
|
|
380 | (1) |
|
|
381 | (2) |
|
|
383 | (1) |
|
7.12 Caching Data for Use When Disconnected |
|
|
384 | (5) |
|
|
384 | (1) |
|
|
384 | (3) |
|
|
387 | (2) |
|
7.13 Joining RowSet Objects When Not Connected to the Data Source |
|
|
389 | (4) |
|
|
389 | (1) |
|
|
389 | (3) |
|
|
392 | (1) |
|
7.14 Querying with a REF_CURSOR |
|
|
393 | (2) |
|
|
393 | (1) |
|
|
394 | (1) |
|
|
394 | (1) |
Chapter 8 Object-Relational Mapping |
|
395 | (46) |
|
|
396 | (4) |
|
|
396 | (1) |
|
|
396 | (3) |
|
|
399 | (1) |
|
|
400 | (3) |
|
|
400 | (1) |
|
|
401 | (1) |
|
|
402 | (1) |
|
8.3 Creating a Persistence Unit |
|
|
403 | (3) |
|
|
403 | (1) |
|
|
403 | (1) |
|
|
404 | (2) |
|
8.4 Using Database Sequences to Create Primary Key Values |
|
|
406 | (4) |
|
|
406 | (1) |
|
|
406 | (2) |
|
|
408 | (2) |
|
8.5 Generating Primary Keys Using More Than One Attribute |
|
|
410 | (8) |
|
|
410 | (1) |
|
|
410 | (3) |
|
|
413 | (3) |
|
|
416 | (2) |
|
8.6 Defining a One-to-One Relationship |
|
|
418 | (2) |
|
|
418 | (1) |
|
|
418 | (2) |
|
|
420 | (1) |
|
8.7 Defining One-to-Many and Many-to-One Relationships |
|
|
420 | (4) |
|
|
420 | (1) |
|
|
421 | (1) |
|
|
422 | (2) |
|
8.8 Defining a Many-to-Many Relationship |
|
|
424 | (4) |
|
|
424 | (1) |
|
|
424 | (2) |
|
|
426 | (2) |
|
8.9 Querying with Named Queries |
|
|
428 | (1) |
|
|
428 | (1) |
|
|
428 | (1) |
|
|
429 | (1) |
|
8.10 Performing Validation on Entity Fields |
|
|
429 | (3) |
|
|
429 | (1) |
|
|
430 | (1) |
|
|
431 | (1) |
|
8.11 Generating Database Schema Objects Automatically |
|
|
432 | (4) |
|
|
432 | (1) |
|
|
432 | (1) |
|
|
432 | (4) |
|
8.12 Mapping Date-Time Values |
|
|
436 | (1) |
|
|
436 | (1) |
|
|
436 | (1) |
|
|
437 | (1) |
|
8.13 Using the Same Annotation Many Times |
|
|
437 | (4) |
|
|
437 | (1) |
|
|
438 | (1) |
|
|
439 | (2) |
Chapter 9 Enterprise JavaBeans |
|
441 | (38) |
|
9.1 Obtaining an Entity Manager |
|
|
441 | (2) |
|
|
441 | (1) |
|
|
442 | (1) |
|
|
442 | (1) |
|
|
442 | (1) |
|
9.2 Developing a Stateless Session Bean |
|
|
443 | (6) |
|
|
443 | (1) |
|
|
443 | (1) |
|
|
444 | (3) |
|
|
447 | (2) |
|
9.3 Developing a Stateful Session Bean |
|
|
449 | (6) |
|
|
449 | (1) |
|
|
449 | (4) |
|
|
453 | (2) |
|
9.4 Utilizing Session Beans with JSF |
|
|
455 | (4) |
|
|
455 | (1) |
|
|
455 | (2) |
|
|
457 | (2) |
|
|
459 | (1) |
|
|
459 | (1) |
|
|
459 | (1) |
|
|
459 | (1) |
|
|
460 | (1) |
|
|
460 | (1) |
|
|
460 | (1) |
|
|
460 | (1) |
|
9.7 Returning Data to Display in a Table |
|
|
460 | (4) |
|
|
460 | (1) |
|
|
461 | (1) |
|
|
462 | (1) |
|
|
463 | (1) |
|
9.8 Creating a Singleton Bean |
|
|
464 | (4) |
|
|
464 | (1) |
|
|
465 | (2) |
|
|
467 | (1) |
|
9.9 Scheduling a Timer Service |
|
|
468 | (4) |
|
|
468 | (1) |
|
|
468 | (1) |
|
|
468 | (1) |
|
|
469 | (3) |
|
9.10 Performing Optional Transaction Lifecycle Callbacks |
|
|
472 | (1) |
|
|
472 | (1) |
|
|
472 | (1) |
|
|
473 | (1) |
|
9.11 Ensuring a Stateful Session Bean Is Not Passivated |
|
|
473 | (1) |
|
|
473 | (1) |
|
|
473 | (1) |
|
|
474 | (1) |
|
9.12 Denoting Local and Remote Interfaces |
|
|
474 | (2) |
|
|
474 | (1) |
|
|
474 | (1) |
|
|
474 | (2) |
|
9.13 Processing Messages Asynchronously from Enterprise Beans |
|
|
476 | (3) |
|
|
476 | (1) |
|
|
476 | (1) |
|
|
477 | (2) |
Chapter 10 The Query API and JPQL |
|
479 | (28) |
|
10.1 Querying All Instances of an Entity |
|
|
479 | (3) |
|
|
479 | (1) |
|
|
479 | (1) |
|
|
480 | (1) |
|
|
480 | (2) |
|
10.2 Setting Parameters to Filter Query Results |
|
|
482 | (2) |
|
|
482 | (1) |
|
|
482 | (1) |
|
|
482 | (1) |
|
|
482 | (2) |
|
10.3 Returning a Single Object |
|
|
484 | (1) |
|
|
484 | (1) |
|
|
484 | (1) |
|
|
484 | (1) |
|
10.4 Creating Native Queries |
|
|
484 | (3) |
|
|
484 | (1) |
|
|
485 | (1) |
|
|
485 | (1) |
|
|
486 | (1) |
|
10.5 Querying More Than One Entity |
|
|
487 | (4) |
|
|
487 | (1) |
|
|
487 | (1) |
|
|
488 | (1) |
|
|
489 | (2) |
|
10.6 Calling JPQL Aggregate Functions |
|
|
491 | (1) |
|
|
491 | (1) |
|
|
491 | (1) |
|
|
492 | (1) |
|
10.7 Invoking Database Stored Procedures Natively |
|
|
492 | (1) |
|
|
492 | (1) |
|
|
492 | (1) |
|
|
493 | (1) |
|
10.8 Joining to Retrieve Instances Matching All Cases |
|
|
493 | (1) |
|
|
493 | (1) |
|
|
493 | (1) |
|
|
494 | (1) |
|
10.9 Joining to Retrieve All Rows Regardless of Match |
|
|
494 | (2) |
|
|
494 | (1) |
|
|
495 | (1) |
|
|
495 | (1) |
|
10.10 Applying JPQL Functional Expressions |
|
|
496 | (2) |
|
|
496 | (1) |
|
|
496 | (1) |
|
|
497 | (1) |
|
10.11 Forcing Query Execution Rather Than Cache Use |
|
|
498 | (1) |
|
|
498 | (1) |
|
|
498 | (1) |
|
|
498 | (1) |
|
10.12 Performing Bulk Updates and Deletes |
|
|
499 | (2) |
|
|
499 | (1) |
|
|
499 | (1) |
|
|
500 | (1) |
|
10.13 Retrieving Entity Subclasses |
|
|
501 | (1) |
|
|
501 | (1) |
|
|
501 | (1) |
|
|
502 | (1) |
|
10.14 Joining with ON Conditions |
|
|
502 | (2) |
|
|
502 | (1) |
|
|
502 | (1) |
|
|
503 | (1) |
|
10.15 Processing Query Results with Streams |
|
|
504 | (1) |
|
|
504 | (1) |
|
|
504 | (1) |
|
|
504 | (1) |
|
10.16 Converting Attribute Data Types |
|
|
505 | (2) |
|
|
505 | (1) |
|
|
505 | (1) |
|
|
506 | (1) |
Chapter 11 Bean Validation |
|
507 | (16) |
|
11.1 Validating Fields with Built-In Constraints |
|
|
508 | (2) |
|
|
508 | (1) |
|
|
508 | (1) |
|
|
508 | (1) |
|
|
509 | (1) |
|
11.2 Writing Custom Constraint Validators |
|
|
510 | (2) |
|
|
510 | (1) |
|
|
510 | (2) |
|
|
512 | (1) |
|
11.3 Validating at the Class Level |
|
|
512 | (3) |
|
|
512 | (1) |
|
|
512 | (2) |
|
|
514 | (1) |
|
11.4 Validating Parameters |
|
|
515 | (1) |
|
|
515 | (1) |
|
|
515 | (1) |
|
|
515 | (1) |
|
11.5 Constructor Validation |
|
|
516 | (1) |
|
|
516 | (1) |
|
|
516 | (1) |
|
|
516 | (1) |
|
11.6 Validating Return Values |
|
|
517 | (1) |
|
|
517 | (1) |
|
|
517 | (1) |
|
|
517 | (1) |
|
11.7 Defining a Dynamic Validation Error Message |
|
|
518 | (1) |
|
|
518 | (1) |
|
|
518 | (1) |
|
|
518 | (1) |
|
11.8 Manually Invoking Validator Engine |
|
|
519 | (1) |
|
|
519 | (1) |
|
|
519 | (1) |
|
|
520 | (1) |
|
11.9 Grouping Validation Constraints |
|
|
520 | (3) |
|
|
520 | (1) |
|
|
520 | (2) |
|
|
522 | (1) |
Chapter 12 Java EE Containers |
|
523 | (36) |
|
12.1 Installing GlassFish 5 or Payara 5 and Starting Up |
|
|
523 | (1) |
|
|
523 | (1) |
|
|
523 | (1) |
|
|
524 | (1) |
|
|
524 | (1) |
|
12.2 Logging into the Administrative Console |
|
|
524 | (6) |
|
|
524 | (1) |
|
|
525 | (1) |
|
|
526 | (4) |
|
12.3 Changing the Administrator User Password |
|
|
530 | (1) |
|
|
530 | (1) |
|
|
530 | (1) |
|
|
530 | (1) |
|
|
531 | (1) |
|
12.4 Deploying a WAR File |
|
|
531 | (3) |
|
|
531 | (1) |
|
|
531 | (2) |
|
|
533 | (1) |
|
|
533 | (1) |
|
12.5 Adding a Database Resource |
|
|
534 | (5) |
|
|
534 | (1) |
|
|
534 | (3) |
|
|
537 | (2) |
|
12.6 Adding Forms-Based Authentication |
|
|
539 | (6) |
|
|
539 | (1) |
|
|
539 | (5) |
|
|
544 | (1) |
|
12.7 Deploying a Microservice to Payara Micro |
|
|
545 | (8) |
|
|
545 | (1) |
|
|
545 | (6) |
|
|
551 | (2) |
|
12.8 Packaging a Web Application with Payara Micro as an Executable JAR |
|
|
553 | (1) |
|
|
553 | (1) |
|
|
553 | (1) |
|
|
554 | (1) |
|
12.9 Deploying Payara Micro Apps on Docker |
|
|
554 | (5) |
|
|
554 | (1) |
|
|
555 | (1) |
|
|
556 | (3) |
Chapter 13 Contexts and Dependency Injection |
|
559 | (32) |
|
13.1 Injecting a Contextual Bean or Other Object |
|
|
560 | (2) |
|
|
560 | (1) |
|
|
560 | (1) |
|
|
561 | (1) |
|
13.2 Binding a Bean to a Web View |
|
|
562 | (3) |
|
|
562 | (1) |
|
|
562 | (2) |
|
|
564 | (1) |
|
13.3 Allocating a Specific Bean for Injection |
|
|
565 | (3) |
|
|
565 | (1) |
|
|
565 | (2) |
|
|
567 | (1) |
|
13.4 Determining the Scope of a Bean |
|
|
568 | (3) |
|
|
568 | (1) |
|
|
568 | (2) |
|
|
570 | (1) |
|
13.5 Injecting Non-Bean Objects |
|
|
571 | (3) |
|
|
571 | (1) |
|
|
571 | (2) |
|
|
573 | (1) |
|
|
574 | (1) |
|
|
574 | (1) |
|
|
574 | (1) |
|
|
574 | (1) |
|
|
575 | (1) |
|
13.7 Disposing of Producer Fields |
|
|
575 | (1) |
|
|
575 | (1) |
|
|
576 | (1) |
|
|
576 | (1) |
|
13.8 Specifying an Alternative Implementation at Deployment Time |
|
|
576 | (1) |
|
|
576 | (1) |
|
|
576 | (1) |
|
|
577 | (1) |
|
13.9 Injecting a Bean and Obtaining Metadata |
|
|
577 | (1) |
|
|
577 | (1) |
|
|
577 | (1) |
|
|
578 | (1) |
|
13.10 Invoking and Processing Events |
|
|
578 | (4) |
|
|
578 | (1) |
|
|
578 | (3) |
|
|
581 | (1) |
|
13.11 Intercepting Method Invocations |
|
|
582 | (3) |
|
|
582 | (1) |
|
|
582 | (2) |
|
|
584 | (1) |
|
13.12 Bootstrapping Java SE Environments |
|
|
585 | (1) |
|
|
585 | (1) |
|
|
585 | (1) |
|
|
586 | (1) |
|
13.13 Enhancing Business Logic of a Method |
|
|
586 | (5) |
|
|
586 | (1) |
|
|
586 | (2) |
|
|
588 | (3) |
Chapter 14 Java Message Service |
|
591 | (22) |
|
14.1 Creating JMS Resources |
|
|
592 | (4) |
|
|
592 | (1) |
|
|
592 | (2) |
|
|
594 | (1) |
|
|
595 | (1) |
|
|
596 | (2) |
|
|
596 | (1) |
|
|
596 | (1) |
|
|
597 | (1) |
|
14.3 Creating and Sending a Message |
|
|
598 | (2) |
|
|
598 | (1) |
|
|
598 | (1) |
|
|
599 | (1) |
|
|
599 | (1) |
|
|
600 | (3) |
|
|
600 | (1) |
|
|
601 | (1) |
|
|
602 | (1) |
|
|
602 | (1) |
|
|
603 | (2) |
|
|
603 | (1) |
|
|
603 | (2) |
|
|
605 | (1) |
|
14.6 Inspecting Message Queues |
|
|
605 | (1) |
|
|
605 | (1) |
|
|
605 | (1) |
|
|
606 | (1) |
|
14.7 Creating Durable Message Subscribers |
|
|
606 | (5) |
|
|
606 | (1) |
|
|
606 | (4) |
|
|
610 | (1) |
|
14.8 Delaying Message Delivery |
|
|
611 | (2) |
|
|
611 | (1) |
|
|
611 | (1) |
|
|
611 | (2) |
Chapter 15 RESTful Web Services |
|
613 | (42) |
|
15.1 Creating a JAX-WS Web Service Endpoint |
|
|
615 | (7) |
|
|
615 | (1) |
|
|
615 | (2) |
|
|
617 | (2) |
|
|
619 | (3) |
|
15.2 Deploying a JAX-WS Web Service |
|
|
622 | (1) |
|
|
622 | (1) |
|
|
622 | (1) |
|
|
622 | (1) |
|
|
623 | (1) |
|
|
623 | (1) |
|
15.3 Consuming a JAX-WS Web Service via WSDL |
|
|
623 | (2) |
|
|
623 | (1) |
|
|
623 | (1) |
|
|
624 | (1) |
|
15.4 Consuming a JAX-WS Web Service via a Stand-Alone Application Client |
|
|
625 | (2) |
|
|
625 | (1) |
|
|
625 | (1) |
|
|
626 | (1) |
|
15.5 Integrating JAX-WS Web Services into a Java EE Project |
|
|
627 | (3) |
|
|
627 | (1) |
|
|
627 | (2) |
|
|
629 | (1) |
|
15.6 Developing a RESTful Web Service |
|
|
630 | (5) |
|
|
630 | (1) |
|
|
630 | (1) |
|
|
631 | (2) |
|
|
633 | (2) |
|
15.7 Consuming and Producing with REST |
|
|
635 | (3) |
|
|
635 | (1) |
|
|
635 | (2) |
|
|
637 | (1) |
|
15.8 Writing a JAX-RS Client |
|
|
638 | (5) |
|
|
638 | (1) |
|
|
638 | (1) |
|
|
639 | (4) |
|
15.9 Filtering Requests and Responses |
|
|
643 | (3) |
|
|
643 | (1) |
|
|
643 | (1) |
|
|
644 | (2) |
|
15.10 Processing Long-Running Operations Asynchronously |
|
|
646 | (3) |
|
|
646 | (1) |
|
|
646 | (1) |
|
|
647 | (2) |
|
15.11 Pushing One-Way Asynchronous Updates from Servers |
|
|
649 | (3) |
|
|
649 | (1) |
|
|
649 | (2) |
|
|
651 | (1) |
|
15.12 Receiving Server Sent Events as a Client |
|
|
652 | (3) |
|
|
652 | (1) |
|
|
652 | (1) |
|
|
653 | (2) |
Chapter 16 WebSockets and JSON |
|
655 | (18) |
|
16.1 Creating a WebSocket Endpoint |
|
|
655 | (1) |
|
|
655 | (1) |
|
|
655 | (1) |
|
|
656 | (1) |
|
16.2 Sending Messages to a WebSocket Endpoint |
|
|
656 | (4) |
|
|
656 | (1) |
|
|
656 | (2) |
|
|
658 | (2) |
|
16.3 Building a JSON Object |
|
|
660 | (2) |
|
|
660 | (1) |
|
|
660 | (1) |
|
|
661 | (1) |
|
16.4 Writing a JSON Object to Disk |
|
|
662 | (1) |
|
|
662 | (1) |
|
|
662 | (1) |
|
|
662 | (1) |
|
16.5 Reading JSON from an Input Source |
|
|
663 | (1) |
|
|
663 | (1) |
|
|
663 | (1) |
|
|
663 | (1) |
|
16.6 Converting Between JSON and Java Objects |
|
|
664 | (3) |
|
|
664 | (1) |
|
|
664 | (2) |
|
|
666 | (1) |
|
16.7 Custom Mapping with JSON-B |
|
|
667 | (2) |
|
|
667 | (1) |
|
|
667 | (1) |
|
|
668 | (1) |
|
16.8 Replacing a Specified Element in a JSON Document |
|
|
669 | (4) |
|
|
669 | (1) |
|
|
669 | (1) |
|
|
670 | (3) |
Chapter 17 Security |
|
673 | (36) |
|
17.1 Setting Up Application Users and Groups in GlassFish |
|
|
674 | (3) |
|
|
674 | (1) |
|
|
674 | (2) |
|
|
676 | (1) |
|
17.2 Performing Basic Web Application Authorization |
|
|
677 | (4) |
|
|
677 | (1) |
|
|
677 | (1) |
|
|
678 | (1) |
|
|
679 | (2) |
|
17.3 Developing a Programmatic Login Form with Custom Authentication Validation |
|
|
681 | (14) |
|
|
681 | (1) |
|
|
681 | (13) |
|
|
694 | (1) |
|
17.4 Authenticating with the Security API Using Database Credentials |
|
|
695 | (7) |
|
|
695 | (1) |
|
|
695 | (5) |
|
|
700 | (2) |
|
17.5 Managing Page Access Within a JSF Application |
|
|
702 | (2) |
|
|
702 | (1) |
|
|
702 | (1) |
|
|
703 | (1) |
|
17.6 Configuring LDAP Authentication Within GlassFish |
|
|
704 | (2) |
|
|
704 | (1) |
|
|
704 | (2) |
|
|
706 | (1) |
|
17.7 Configuring Custom Security Certificates Within GlassFish/Payara |
|
|
706 | (3) |
|
|
706 | (1) |
|
|
706 | (1) |
|
|
707 | (2) |
Chapter 18 Concurrency and Batch Applications |
|
709 | (24) |
|
18.1 Creating Resources for Processing Tasks Asynchronously in an Application Server |
|
|
710 | (3) |
|
|
710 | (1) |
|
|
710 | (1) |
|
|
711 | (1) |
|
|
712 | (1) |
|
18.2 Configuring and Creating a Reporter Task |
|
|
713 | (4) |
|
|
713 | (1) |
|
|
713 | (3) |
|
|
716 | (1) |
|
18.3 Running More Than One Task Concurrently |
|
|
717 | (3) |
|
|
717 | (1) |
|
|
717 | (2) |
|
|
719 | (1) |
|
18.4 Utilizing Transactions Within a Task |
|
|
720 | (2) |
|
|
720 | (1) |
|
|
720 | (1) |
|
|
721 | (1) |
|
18.5 Running Concurrent Tasks at Scheduled Times |
|
|
722 | (3) |
|
|
722 | (1) |
|
|
722 | (2) |
|
|
724 | (1) |
|
18.6 Creating Thread Instances |
|
|
725 | (2) |
|
|
725 | (1) |
|
|
725 | (1) |
|
|
726 | (1) |
|
18.7 Creating an Item-Oriented Batch Process |
|
|
727 | (6) |
|
|
727 | (1) |
|
|
727 | (3) |
|
|
730 | (3) |
Appendix A: Java EE Development with Apache NetBeans IDE |
|
733 | (14) |
|
A.1 Configuring Application Servers Within NetBeans |
|
|
733 | (2) |
|
Developing Java Web or Enterprise Applications |
|
|
735 | (1) |
|
A.2 Creating a NetBeans Java Web Project |
|
|
735 | (3) |
|
A.3 Creating JSF Application Files |
|
|
738 | (3) |
|
A.4 Developing Entity Classes |
|
|
741 | (1) |
|
|
742 | (1) |
|
|
742 | (5) |
Index |
|
747 | |