About the Authors |
|
xxxi | |
About the Technical Reviewer |
|
xxxiii | |
Acknowledgments |
|
xxxv | |
Introduction |
|
xxxvii | |
|
Chapter 1 Spring Development Tools |
|
|
1 | (26) |
|
1-1 Build a Spring Application with the Spring Tool Suite |
|
|
1 | (9) |
|
|
1 | (1) |
|
|
1 | (1) |
|
|
2 | (8) |
|
1-2 Build a Spring Application with the IntelliJ IDE |
|
|
10 | (10) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (10) |
|
1-3 Build a Spring Application with the Maven Command-Line Interface |
|
|
20 | (2) |
|
|
20 | (1) |
|
|
21 | (1) |
|
|
21 | (1) |
|
1-4 Build a Spring Application with the Gradle Wrapper |
|
|
22 | (1) |
|
|
22 | (1) |
|
|
22 | (1) |
|
|
22 | (1) |
|
1-5 Build a Spring Application with the Gradle Command-Line Interface |
|
|
23 | (2) |
|
|
23 | (1) |
|
|
23 | (1) |
|
|
24 | (1) |
|
1-6 Build a Spring Application with the Gradle Wrapper |
|
|
25 | (2) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
Chapter 2 Spring Core Tasks |
|
|
27 | (90) |
|
2-1 Use a Java Config to Configure POJOs |
|
|
28 | (6) |
|
|
28 | (1) |
|
|
28 | (1) |
|
|
28 | (6) |
|
2-2 Create POJOs by Invoking a Constructor |
|
|
34 | (3) |
|
|
34 | (1) |
|
|
34 | (1) |
|
|
34 | (3) |
|
2-3 Use POJO References and Autowiring to Interact with Other POJOs |
|
|
37 | (7) |
|
|
37 | (1) |
|
|
37 | (1) |
|
|
37 | (7) |
|
2-4 Autowire POJOs with the @Resource and @Inject Annotations |
|
|
44 | (2) |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
44 | (2) |
|
2-5 Set a POJO's Scope with the @Scope Annotation |
|
|
46 | (3) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
47 | (2) |
|
2-6 Use Data from External Resources (Text Files, XML Files, Properties Files, or Image Files) |
|
|
49 | (5) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (4) |
|
2-7 Resolve 118N Text Messages for Different Locales in Properties Files |
|
|
54 | (2) |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
54 | (2) |
|
2-8 Customize POJO Initialization and Destruction with Annotations |
|
|
56 | (5) |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
57 | (4) |
|
2-9 Create Post-Processors to Validate and Modify POJOs |
|
|
61 | (3) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
61 | (3) |
|
2-10 Create POJOs with a Factory (Static Method, Instance Method, Spring's FactoryBean) |
|
|
64 | (5) |
|
|
64 | (1) |
|
|
64 | (1) |
|
|
64 | (5) |
|
2-11 Use Spring Environments and Profiles to Load Different Sets of POJOs |
|
|
69 | (2) |
|
|
69 | (1) |
|
|
69 | (1) |
|
|
69 | (2) |
|
2-12 Make POJOs Aware of Spring's IoC Container Resources |
|
|
71 | (2) |
|
|
71 | (1) |
|
|
71 | (2) |
|
|
73 | (1) |
|
2-13 Use Aspect-Oriented Programming with Annotations |
|
|
73 | (8) |
|
|
73 | (1) |
|
|
73 | (1) |
|
|
74 | (7) |
|
2-14 Access the Join Point Information |
|
|
81 | (2) |
|
|
81 | (1) |
|
|
81 | (1) |
|
|
82 | (1) |
|
2-15 Specify Aspect Precedence with the @Order Annotation |
|
|
83 | (2) |
|
|
83 | (1) |
|
|
83 | (1) |
|
|
83 | (2) |
|
2-16 Reuse Aspect Pointcut Definitions |
|
|
85 | (2) |
|
|
85 | (1) |
|
|
85 | (1) |
|
|
85 | (2) |
|
2-17 Write AspectJ Pointcut Expressions |
|
|
87 | (5) |
|
|
87 | (1) |
|
|
87 | (1) |
|
|
87 | (5) |
|
2-18 Use AOP for introductions for POJOs |
|
|
92 | (2) |
|
|
92 | (1) |
|
|
92 | (1) |
|
|
92 | (2) |
|
2-19 Introduce States to Your POJOs with AOP |
|
|
94 | (3) |
|
|
94 | (1) |
|
|
94 | (1) |
|
|
95 | (2) |
|
2-20 Use Load-Time Weaving AspectJ Aspects in Spring |
|
|
97 | (4) |
|
|
97 | (1) |
|
|
97 | (1) |
|
|
97 | (4) |
|
2-21 Configure AspectJ Aspects in Spring |
|
|
101 | (2) |
|
|
101 | (1) |
|
|
101 | (1) |
|
|
102 | (1) |
|
2-22 Inject POJOs into Domain Objects with AOP |
|
|
103 | (2) |
|
|
103 | (1) |
|
|
103 | (1) |
|
|
104 | (1) |
|
2-23 Applying Concurrency with Spring and TaskExecutors |
|
|
105 | (7) |
|
|
105 | (1) |
|
|
105 | (1) |
|
|
106 | (6) |
|
2-24 Communicate Application Events Between POJOs |
|
|
112 | (5) |
|
|
112 | (1) |
|
|
112 | (1) |
|
|
112 | (3) |
|
|
115 | (2) |
|
|
117 | (66) |
|
3-1 Develop a Simple Web Application with Spring MVC |
|
|
117 | (12) |
|
|
117 | (1) |
|
|
117 | (2) |
|
|
119 | (10) |
|
3-2 Map Requests with @RequestMapping |
|
|
129 | (4) |
|
|
129 | (1) |
|
|
129 | (1) |
|
|
129 | (4) |
|
3-3 Intercept Requests with Handler Interceptors |
|
|
133 | (3) |
|
|
133 | (1) |
|
|
133 | (1) |
|
|
134 | (2) |
|
|
136 | (3) |
|
|
136 | (1) |
|
|
137 | (1) |
|
|
137 | (1) |
|
|
138 | (1) |
|
3-5 Externalize Locale-Sensitive Text Messages |
|
|
139 | (2) |
|
|
139 | (1) |
|
|
139 | (1) |
|
|
140 | (1) |
|
3-6 Resolve Views by Name |
|
|
141 | (3) |
|
|
141 | (1) |
|
|
141 | (1) |
|
|
141 | (3) |
|
3-7 Use Views and Content Negotiation |
|
|
144 | (2) |
|
|
144 | (1) |
|
|
144 | (1) |
|
|
144 | (2) |
|
3-8 Map Exceptions to Views |
|
|
146 | (3) |
|
|
146 | (1) |
|
|
146 | (1) |
|
|
147 | (2) |
|
3-9 Handle Forms with Controllers |
|
|
149 | (13) |
|
|
149 | (1) |
|
|
149 | (1) |
|
|
149 | (13) |
|
3-10 Handle Multipage Forms with Wizard Form Controllers |
|
|
162 | (11) |
|
|
162 | (1) |
|
|
162 | (1) |
|
|
163 | (10) |
|
3-11 Use Bean Validation with Annotations (JSR-303) |
|
|
173 | (2) |
|
|
173 | (1) |
|
|
173 | (1) |
|
|
174 | (1) |
|
3-12 Create Excel and PDF Views |
|
|
175 | (8) |
|
|
175 | (1) |
|
|
175 | (1) |
|
|
176 | (5) |
|
|
181 | (2) |
|
|
183 | (26) |
|
4-1 Publish XML with REST Services |
|
|
183 | (8) |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
184 | (7) |
|
4-2 Publish JSON with REST Services |
|
|
191 | (5) |
|
|
191 | (1) |
|
|
191 | (1) |
|
|
192 | (4) |
|
4-3 Access a REST Service with Spring |
|
|
196 | (4) |
|
|
196 | (1) |
|
|
196 | (1) |
|
|
196 | (4) |
|
4-4 Publish RSS and Atom Feeds |
|
|
200 | (9) |
|
|
200 | (1) |
|
|
200 | (1) |
|
|
200 | (8) |
|
|
208 | (1) |
|
Chapter 5 Spring MVC: Async Processing |
|
|
209 | (58) |
|
5-1 Handle Requests Asynchronously with Controllers and TaskExecutor |
|
|
209 | (8) |
|
|
209 | (1) |
|
|
209 | (1) |
|
|
210 | (7) |
|
|
217 | (5) |
|
|
217 | (1) |
|
|
217 | (1) |
|
|
217 | (5) |
|
5-3 Use Asynchronous Interceptors |
|
|
222 | (2) |
|
|
222 | (1) |
|
|
222 | (1) |
|
|
222 | (2) |
|
|
224 | (9) |
|
|
224 | (1) |
|
|
224 | (1) |
|
|
225 | (8) |
|
5-5 Develop a Reactive Application with Spring WebFlux |
|
|
233 | (11) |
|
|
233 | (1) |
|
|
233 | (2) |
|
|
235 | (9) |
|
5-6 Handle Forms with Reactive Controllers |
|
|
244 | (13) |
|
|
244 | (1) |
|
|
244 | (1) |
|
|
244 | (13) |
|
5-7 Publish and Consume JSON with Reactive REST Services |
|
|
257 | (2) |
|
|
257 | (1) |
|
|
257 | (1) |
|
|
257 | (2) |
|
5-8 Use an Asynchronous Web Client |
|
|
259 | (5) |
|
|
259 | (1) |
|
|
259 | (1) |
|
|
260 | (4) |
|
5-9 Write a Reactive Handler Function |
|
|
264 | (3) |
|
|
264 | (1) |
|
|
264 | (1) |
|
|
264 | (2) |
|
|
266 | (1) |
|
|
267 | (30) |
|
|
267 | (2) |
|
|
267 | (1) |
|
|
267 | (1) |
|
|
267 | (2) |
|
|
269 | (5) |
|
|
269 | (1) |
|
|
269 | (1) |
|
|
269 | (5) |
|
|
274 | (3) |
|
|
274 | (1) |
|
|
274 | (1) |
|
|
274 | (3) |
|
6-4 Show the Service Provider's Connection Status |
|
|
277 | (5) |
|
|
277 | (1) |
|
|
277 | (1) |
|
|
277 | (5) |
|
|
282 | (2) |
|
|
282 | (1) |
|
|
282 | (1) |
|
|
283 | (1) |
|
6-6 Use a Persistent Users Connection Repository |
|
|
284 | (2) |
|
|
284 | (1) |
|
|
284 | (1) |
|
|
284 | (2) |
|
6-7 Integrate Spring Social and Spring Security |
|
|
286 | (11) |
|
|
286 | (1) |
|
|
286 | (1) |
|
|
286 | (9) |
|
|
295 | (2) |
|
Chapter 7 Spring Security |
|
|
297 | (48) |
|
|
298 | (5) |
|
|
298 | (1) |
|
|
298 | (1) |
|
|
299 | (4) |
|
7-2 Log In to Web Applications |
|
|
303 | (7) |
|
|
303 | (1) |
|
|
303 | (1) |
|
|
303 | (7) |
|
|
310 | (9) |
|
|
310 | (1) |
|
|
310 | (1) |
|
|
310 | (9) |
|
7-4 Make Access Control Decisions |
|
|
319 | (8) |
|
|
319 | (1) |
|
|
319 | (1) |
|
|
320 | (7) |
|
7-5 Secure Method Invocations |
|
|
327 | (3) |
|
|
327 | (1) |
|
|
327 | (1) |
|
|
327 | (3) |
|
7-6 Handle Security in Views |
|
|
330 | (2) |
|
|
330 | (1) |
|
|
330 | (1) |
|
|
330 | (2) |
|
7-7 Handle Domain Object Security |
|
|
332 | (8) |
|
|
332 | (1) |
|
|
332 | (1) |
|
|
332 | (8) |
|
7-8 Add Security to a WebFlux Application |
|
|
340 | (5) |
|
|
340 | (1) |
|
|
340 | (1) |
|
|
340 | (4) |
|
|
344 | (1) |
|
|
345 | (16) |
|
8-1 Detect Devices Without Spring Mobile |
|
|
345 | (5) |
|
|
345 | (1) |
|
|
345 | (1) |
|
|
345 | (5) |
|
8-2 Detect Devices with Spring Mobile |
|
|
350 | (2) |
|
|
350 | (1) |
|
|
350 | (1) |
|
|
350 | (2) |
|
|
352 | (2) |
|
|
352 | (1) |
|
|
352 | (1) |
|
|
352 | (2) |
|
8-4 Use the Device Information to Render Views |
|
|
354 | (4) |
|
|
354 | (1) |
|
|
354 | (1) |
|
|
354 | (4) |
|
8-5 Implement Site Switching |
|
|
358 | (3) |
|
|
358 | (1) |
|
|
358 | (1) |
|
|
358 | (2) |
|
|
360 | (1) |
|
|
361 | (54) |
|
Problems with Direct JDBC |
|
|
362 | (1) |
|
Setting Up the Application Database |
|
|
362 | (1) |
|
Understanding the Data Access Object Design Pattern |
|
|
363 | (1) |
|
Implementing the DAO with JDBC |
|
|
364 | (2) |
|
Configuring a Data Source in Spring |
|
|
366 | (2) |
|
|
368 | (1) |
|
|
368 | (1) |
|
9-1 Use a JDBC Template to Update a Database |
|
|
368 | (5) |
|
|
368 | (1) |
|
|
369 | (1) |
|
|
369 | (4) |
|
9-2 Use a JDBC Template to Query a Database |
|
|
373 | (6) |
|
|
373 | (1) |
|
|
374 | (1) |
|
|
374 | (5) |
|
9-3 Simplify JDBC Template Creation |
|
|
379 | (3) |
|
|
379 | (1) |
|
|
379 | (1) |
|
|
379 | (3) |
|
9-4 Use Named Parameters in a JDBC Template |
|
|
382 | (2) |
|
|
382 | (1) |
|
|
382 | (1) |
|
|
382 | (2) |
|
9-5 Handle Exceptions in the Spring JDBC Framework |
|
|
384 | (5) |
|
|
384 | (1) |
|
|
384 | (1) |
|
|
385 | (4) |
|
9-6 Avoid Problems by Using ORM Frameworks Directly |
|
|
389 | (9) |
|
|
389 | (1) |
|
|
389 | (1) |
|
|
389 | (9) |
|
9-7 Configure ORM Resource Factories in Spring |
|
|
398 | (8) |
|
|
398 | (1) |
|
|
399 | (1) |
|
|
399 | (7) |
|
9-8 Persist Objects with Hibernate's Contextual Sessions |
|
|
406 | (3) |
|
|
406 | (1) |
|
|
406 | (1) |
|
|
407 | (2) |
|
9-9 Persist Objects with JPA's Context Injection |
|
|
409 | (3) |
|
|
409 | (1) |
|
|
409 | (1) |
|
|
409 | (3) |
|
9-10 Simplify JPA with Spring Data JPA |
|
|
412 | (3) |
|
|
412 | (1) |
|
|
412 | (1) |
|
|
413 | (1) |
|
|
414 | (1) |
|
Chapter 10 Spring Transaction Management |
|
|
415 | (32) |
|
10-1 Avoid Problems with Transaction Management |
|
|
416 | (7) |
|
Manage Transactions with JDBC Commit and Rollback |
|
|
422 | (1) |
|
10-2 Choose a Transaction Manager Implementation |
|
|
423 | (1) |
|
|
423 | (1) |
|
|
423 | (1) |
|
|
423 | (1) |
|
10-3 Manage Transactions Programmatically with the Transaction Manager API |
|
|
424 | (3) |
|
|
424 | (1) |
|
|
425 | (1) |
|
|
425 | (2) |
|
10-4 Manage Transactions Programmatically with a Transaction Template |
|
|
427 | (3) |
|
|
427 | (1) |
|
|
427 | (1) |
|
|
427 | (3) |
|
10-5 Manage Transactions Declaratively with the @Transactional Annotation |
|
|
430 | (1) |
|
|
430 | (1) |
|
|
430 | (1) |
|
|
430 | (1) |
|
10-6 Set the Propagation Transaction Attribute |
|
|
431 | (5) |
|
|
431 | (1) |
|
|
431 | (1) |
|
|
432 | (4) |
|
10-7 Set the Isolation Transaction Attribute |
|
|
436 | (8) |
|
|
436 | (1) |
|
|
436 | (1) |
|
|
437 | (7) |
|
10-8 Set the Rollback Transaction Attribute |
|
|
444 | (1) |
|
|
444 | (1) |
|
|
444 | (1) |
|
|
444 | (1) |
|
10-9 Set the Timeout and Read-Only Transaction Attributes |
|
|
444 | (1) |
|
|
444 | (1) |
|
|
445 | (1) |
|
|
445 | (1) |
|
10-10 Manage Transactions with Load-Time Weaving |
|
|
445 | (2) |
|
|
445 | (1) |
|
|
445 | (1) |
|
|
446 | (1) |
|
|
446 | (1) |
|
|
447 | (36) |
|
|
448 | (1) |
|
11-1 Set Up Spring Batch's Infrastructure |
|
|
449 | (4) |
|
|
449 | (1) |
|
|
449 | (1) |
|
|
449 | (4) |
|
|
453 | (7) |
|
|
453 | (1) |
|
|
453 | (1) |
|
|
453 | (7) |
|
11-3 Write a Custom ItemWriter and ItemReader |
|
|
460 | (3) |
|
|
460 | (1) |
|
|
460 | (1) |
|
|
460 | (3) |
|
11-4 Process Input Before Writing |
|
|
463 | (2) |
|
|
463 | (1) |
|
|
463 | (1) |
|
|
463 | (2) |
|
11-5 Achieve Better Living Through Transactions |
|
|
465 | (2) |
|
|
465 | (1) |
|
|
465 | (1) |
|
|
465 | (2) |
|
|
467 | (3) |
|
|
467 | (1) |
|
|
467 | (1) |
|
|
467 | (3) |
|
11-7 Control Step Execution |
|
|
470 | (4) |
|
|
470 | (1) |
|
|
470 | (1) |
|
|
471 | (3) |
|
|
474 | (5) |
|
|
474 | (1) |
|
|
475 | (1) |
|
|
475 | (4) |
|
|
479 | (4) |
|
|
479 | (1) |
|
|
479 | (1) |
|
|
479 | (2) |
|
|
481 | (2) |
|
Chapter 12 Spring with NoSQL |
|
|
483 | (58) |
|
|
483 | (14) |
|
|
483 | (1) |
|
|
483 | (1) |
|
|
484 | (13) |
|
|
497 | (6) |
|
|
497 | (1) |
|
|
497 | (1) |
|
|
497 | (6) |
|
|
503 | (18) |
|
|
503 | (1) |
|
|
503 | (1) |
|
|
503 | (18) |
|
|
521 | (20) |
|
|
521 | (1) |
|
|
521 | (1) |
|
|
521 | (19) |
|
|
540 | (1) |
|
Chapter 13 Spring Java Enterprise Services and Remoting Technologies |
|
|
541 | (74) |
|
13-1 Register Spring POJOs as JMX MBeans |
|
|
541 | (16) |
|
|
541 | (1) |
|
|
542 | (1) |
|
|
542 | (15) |
|
13-2 Publish and Listen to JMX Notifications |
|
|
557 | (2) |
|
|
557 | (1) |
|
|
557 | (1) |
|
|
557 | (2) |
|
13-3 Access Remote JMX MBeans in Spring |
|
|
559 | (5) |
|
|
559 | (1) |
|
|
559 | (1) |
|
|
560 | (4) |
|
13-4 Send E-mail with Spring's E-mail Support |
|
|
564 | (8) |
|
|
564 | (1) |
|
|
564 | (1) |
|
|
564 | (8) |
|
13-5 Schedule Tasks with Spring's Quartz Support |
|
|
572 | (5) |
|
|
572 | (1) |
|
|
572 | (1) |
|
|
572 | (5) |
|
13-6 Schedule Tasks with Spring's Scheduling |
|
|
577 | (3) |
|
|
577 | (1) |
|
|
577 | (1) |
|
|
577 | (3) |
|
13-7 Expose and Invoke Services Through RMI |
|
|
580 | (4) |
|
|
580 | (1) |
|
|
580 | (1) |
|
|
581 | (3) |
|
13-8 Expose and Invoke Services Through HTTP |
|
|
584 | (4) |
|
|
584 | (1) |
|
|
585 | (1) |
|
|
585 | (3) |
|
13-9 Expose and Invoke SOAP Web Services with JAX-WS |
|
|
588 | (6) |
|
|
588 | (1) |
|
|
588 | (1) |
|
|
588 | (6) |
|
13-10 Use Contract-First SOAP Web Services |
|
|
594 | (5) |
|
|
594 | (1) |
|
|
594 | (1) |
|
|
594 | (5) |
|
13-11 Expose and Invoke SOAP Web Services with Spring-WS |
|
|
599 | (7) |
|
|
599 | (1) |
|
|
599 | (7) |
|
13-12 Develop SOAP Web Services with Spring-WS and XML Marshalling |
|
|
606 | (9) |
|
|
606 | (1) |
|
|
607 | (1) |
|
|
607 | (6) |
|
|
613 | (2) |
|
Chapter 14 Spring Messaging |
|
|
615 | (40) |
|
14-1 Send and Receive JMS Messages with Spring |
|
|
615 | (12) |
|
|
615 | (1) |
|
|
616 | (1) |
|
|
616 | (11) |
|
14-2 Convert JMS Messages |
|
|
627 | (3) |
|
|
627 | (1) |
|
|
627 | (1) |
|
|
627 | (3) |
|
14-3 Manage JMS Transactions |
|
|
630 | (1) |
|
|
630 | (1) |
|
|
630 | (1) |
|
|
630 | (1) |
|
14-4 Create Message-Driven POJOs in Spring |
|
|
631 | (7) |
|
|
631 | (1) |
|
|
631 | (1) |
|
|
632 | (6) |
|
14-5 Cache and Pool JMS Connections |
|
|
638 | (1) |
|
|
638 | (1) |
|
|
638 | (1) |
|
|
638 | (1) |
|
14-6 Send and Receive AMQP Messages with Spring |
|
|
639 | (7) |
|
|
639 | (1) |
|
|
639 | (1) |
|
|
639 | (7) |
|
14-7 Send and Receive Messages with Spring Kafka |
|
|
646 | (9) |
|
|
646 | (1) |
|
|
646 | (1) |
|
|
646 | (8) |
|
|
654 | (1) |
|
Chapter 15 Spring Integration |
|
|
655 | (36) |
|
15-1 Integrate One System with Another Using EAI |
|
|
655 | (3) |
|
|
655 | (1) |
|
|
655 | (1) |
|
|
655 | (3) |
|
15-2 Integrate Two Systems Using JMS |
|
|
658 | (4) |
|
|
658 | (1) |
|
|
658 | (1) |
|
|
658 | (4) |
|
15-3 Interrogate Spring Integration Messages for Context Information |
|
|
662 | (3) |
|
|
662 | (1) |
|
|
662 | (1) |
|
|
662 | (3) |
|
15-4 Integrate Two Systems Using a File System |
|
|
665 | (2) |
|
|
665 | (1) |
|
|
665 | (1) |
|
|
666 | (1) |
|
15-5 Transform a Message from One Type to Another |
|
|
667 | (4) |
|
|
667 | (1) |
|
|
668 | (1) |
|
|
668 | (3) |
|
15-6 Handle Errors Using Spring Integration |
|
|
671 | (3) |
|
|
671 | (1) |
|
|
671 | (1) |
|
|
671 | (3) |
|
15-7 Fork Integration Control: Splitters and Aggregators |
|
|
674 | (4) |
|
|
674 | (1) |
|
|
674 | (1) |
|
|
674 | (4) |
|
15-8 Implement Conditional Routing with Routers |
|
|
678 | (1) |
|
|
678 | (1) |
|
|
678 | (1) |
|
|
678 | (1) |
|
15-9 Stage Events Using Spring Batch |
|
|
679 | (3) |
|
|
679 | (1) |
|
|
679 | (1) |
|
|
679 | (3) |
|
|
682 | (9) |
|
|
682 | (1) |
|
|
682 | (1) |
|
|
682 | (7) |
|
|
689 | (2) |
|
Chapter 16 Spring Testing |
|
|
691 | (40) |
|
16-1 Create Tests with JUnit and TestNG |
|
|
692 | (4) |
|
|
692 | (1) |
|
|
692 | (1) |
|
|
692 | (4) |
|
16-2 Create Unit Tests and Integration Tests |
|
|
696 | (9) |
|
|
696 | (1) |
|
|
696 | (1) |
|
|
697 | (8) |
|
16-3 Implement Unit Testing for Spring MVC Controllers |
|
|
705 | (2) |
|
|
705 | (1) |
|
|
705 | (1) |
|
|
706 | (1) |
|
16-4 Manage Application Contexts in Integration Tests |
|
|
707 | (5) |
|
|
707 | (1) |
|
|
707 | (1) |
|
|
708 | (4) |
|
16-5 Inject Test Fixtures into Integration Tests |
|
|
712 | (2) |
|
|
712 | (1) |
|
|
712 | (1) |
|
|
712 | (2) |
|
16-6 Manage Transactions in Integration Tests |
|
|
714 | (5) |
|
|
714 | (1) |
|
|
714 | (1) |
|
|
715 | (4) |
|
16-7 Access a Database in Integration Tests |
|
|
719 | (2) |
|
|
719 | (1) |
|
|
719 | (1) |
|
|
719 | (2) |
|
16-8 Use Spring's Common Testing Annotations |
|
|
721 | (2) |
|
|
721 | (1) |
|
|
722 | (1) |
|
|
722 | (1) |
|
16-9 Implement Integration Tests for Spring MVC Controllers |
|
|
723 | (3) |
|
|
723 | |
|
|
723 | (1) |
|
|
723 | (3) |
|
16-10 Write Integration Tests for REST Clients |
|
|
726 | (5) |
|
|
726 | (1) |
|
|
726 | (1) |
|
|
726 | (4) |
|
|
730 | (1) |
|
|
731 | (44) |
|
17-1 Get and Install Grails |
|
|
731 | (1) |
|
|
731 | (1) |
|
|
731 | (1) |
|
|
731 | (1) |
|
17-2 Create a Grails Application |
|
|
732 | (5) |
|
|
732 | (1) |
|
|
732 | (1) |
|
|
732 | (5) |
|
|
737 | (1) |
|
|
737 | (1) |
|
|
737 | (1) |
|
|
738 | (1) |
|
17-4 Develop, Produce, and Test in Grails Environments |
|
|
738 | (2) |
|
|
738 | (1) |
|
|
738 | (1) |
|
|
739 | (1) |
|
17-5 Create an Application's Domain Classes |
|
|
740 | (3) |
|
|
740 | (1) |
|
|
740 | (1) |
|
|
741 | (2) |
|
17-6 Generate CRUD Controllers and Views for an Application's Domain Classes |
|
|
743 | (4) |
|
|
743 | (1) |
|
|
743 | (1) |
|
|
743 | (4) |
|
17-7 Implement Internationalization (l18n) for Message Properties |
|
|
747 | (3) |
|
|
747 | (1) |
|
|
747 | (1) |
|
|
747 | (3) |
|
17-8 Change Permanent Storage Systems |
|
|
750 | (3) |
|
|
750 | (1) |
|
|
750 | (1) |
|
|
750 | (3) |
|
17-9 Customize Log Output |
|
|
753 | (2) |
|
|
753 | (1) |
|
|
753 | (1) |
|
|
753 | (2) |
|
17-10 Run Unit and Integration Tests |
|
|
755 | (6) |
|
|
755 | (1) |
|
|
755 | (1) |
|
|
755 | (6) |
|
17-11 Use Custom Layouts and Templates |
|
|
761 | (3) |
|
|
761 | (1) |
|
|
761 | (1) |
|
|
761 | (3) |
|
|
764 | (2) |
|
|
764 | (1) |
|
|
764 | (1) |
|
|
764 | (2) |
|
|
766 | (2) |
|
|
766 | (1) |
|
|
766 | (1) |
|
|
766 | (2) |
|
|
768 | (7) |
|
|
768 | (1) |
|
|
768 | (1) |
|
|
768 | (4) |
|
|
772 | (3) |
|
Appendix A Deploying to the Cloud |
|
|
775 | (20) |
|
A-1 Sign Up for CloudFoundry |
|
|
775 | (6) |
|
|
775 | (1) |
|
|
775 | (1) |
|
|
776 | (5) |
|
A-2 Install and Use the CloudFoundry CLI |
|
|
781 | (3) |
|
|
781 | (1) |
|
|
781 | (1) |
|
|
781 | (3) |
|
A-3 Deploy a Spring MVC Application |
|
|
784 | (10) |
|
|
784 | (1) |
|
|
784 | (1) |
|
|
784 | (10) |
|
A-4 Remove an Application |
|
|
794 | (1) |
|
|
794 | (1) |
|
|
794 | (1) |
|
|
794 | (1) |
|
|
794 | (1) |
|
|
795 | (26) |
|
B-1 Implement Caching with Ehcache |
|
|
795 | (5) |
|
|
795 | (1) |
|
|
795 | (1) |
|
|
795 | (5) |
|
B-2 Cache with Spring's Cache Abstraction |
|
|
800 | (3) |
|
|
800 | (1) |
|
|
800 | (1) |
|
|
801 | (2) |
|
B-3 Implement Declarative Caching with AOP |
|
|
803 | (2) |
|
|
803 | (1) |
|
|
803 | (1) |
|
|
803 | (2) |
|
B-4 Configure a Custom KeyGenerator |
|
|
805 | (2) |
|
|
805 | (1) |
|
|
805 | (1) |
|
|
805 | (2) |
|
B-5 Add and Remove Objects from the Cache |
|
|
807 | (9) |
|
|
807 | (1) |
|
|
807 | (1) |
|
|
807 | (9) |
|
B-6 Synchronize Caching with a Transactional Resource |
|
|
816 | (3) |
|
|
816 | (1) |
|
|
816 | (1) |
|
|
817 | (2) |
|
B-7 Use Redis as a Cache Provider |
|
|
819 | (2) |
|
|
819 | (1) |
|
|
819 | (1) |
|
|
819 | (1) |
|
|
820 | (1) |
Index |
|
821 | |