Contents at a Glance |
|
v | |
About the Authors |
|
xxix | |
About the Technical Reviewer |
|
xxx | |
|
Chapter 1 Introducing Spring |
|
|
1 | (12) |
|
|
1 | (8) |
|
Inverting Control or Injecting Dependencies? |
|
|
2 | (1) |
|
Evolution of Dependency Injection |
|
|
3 | (1) |
|
Beyond Dependency Injection |
|
|
4 | (1) |
|
Aspect-Oriented Programming with Spring |
|
|
4 | (1) |
|
Spring Expression Language (SpEL) |
|
|
5 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
Object/XML Mapping (OXM) in Spring in Spring |
|
|
6 | (1) |
|
|
7 | (1) |
|
Simplifying and Integrating with JEE |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
Dynamic Scripting Support |
|
|
9 | (1) |
|
Simplified Exception Handling |
|
|
9 | (1) |
|
|
9 | (2) |
|
|
10 | (1) |
|
|
10 | (1) |
|
Spring for Microsoft .NET |
|
|
10 | (1) |
|
The SpringSource Tool Suite/Spring IDE |
|
|
10 | (1) |
|
The Spring Security Project |
|
|
11 | (1) |
|
Spring Batch and Integration |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
Chapter 2 Getting Started |
|
|
13 | (24) |
|
Obtaining the Spring Framework |
|
|
14 | (1) |
|
Downloading a Standard Distribution |
|
|
14 | (1) |
|
Checking Spring Out of GitHub |
|
|
14 | (1) |
|
Understanding Spring Packaging |
|
|
14 | (6) |
|
|
15 | (2) |
|
Choosing Modules for Your Application |
|
|
17 | (1) |
|
Spring Modules on the Maven Repository |
|
|
18 | (2) |
|
Analyzing Spring Dependencies |
|
|
20 | (3) |
|
|
23 | (4) |
|
Obtaining Spring Samples Source Code |
|
|
23 | (1) |
|
The Petclinic Application |
|
|
24 | (1) |
|
The Petclinic Groovy Application |
|
|
24 | (1) |
|
The jPetStore Application |
|
|
25 | (1) |
|
Spring Configuration Basic Application |
|
|
25 | (1) |
|
Spring Task and Scheduling Application |
|
|
25 | (1) |
|
The Spring MVC Showcase Application |
|
|
25 | (1) |
|
The Spring MVC Basic and Ajax Application |
|
|
26 | (1) |
|
The Spring Petcare Application |
|
|
26 | (1) |
|
Spring Webflow Sample Applications |
|
|
26 | (1) |
|
|
27 | (1) |
|
Putting a Spring into "Hello World!" |
|
|
27 | (8) |
|
Building the Sample "Hello World!" Application |
|
|
27 | (5) |
|
Create Spring Project in STS |
|
|
32 | (1) |
|
|
33 | (2) |
|
|
35 | (2) |
|
Chapter 3 The Sample Application |
|
|
37 | (16) |
|
Requirements of the SpringBlog Application |
|
|
37 | (14) |
|
Security and Authentication |
|
|
38 | (1) |
|
|
39 | (1) |
|
|
40 | (1) |
|
Commenting on a Blog Entry |
|
|
41 | (1) |
|
Filtering Out Obscenities |
|
|
42 | (2) |
|
Attaching Files to a Blog Entry or Comment |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
45 | (1) |
|
Upload Blog from an XML File |
|
|
45 | (1) |
|
|
45 | (1) |
|
Development Tool and Dependency Management |
|
|
46 | (1) |
|
|
46 | (1) |
|
Application Configuration Management |
|
|
46 | (1) |
|
SpringBlog's Layered Application Architecture |
|
|
47 | (1) |
|
Implementing the Persistence Layer |
|
|
48 | (1) |
|
Implementing the Service Layer |
|
|
49 | (1) |
|
Using AOP for Obscenity Filtering |
|
|
49 | (1) |
|
Using Spring Transaction Support |
|
|
49 | (1) |
|
|
50 | (1) |
|
Two Different Service Layers Implementation |
|
|
50 | (1) |
|
Implementing the Batch and Integration Layer |
|
|
50 | (1) |
|
Implementing the Presentation Layer |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
Implementing the Security Layer |
|
|
51 | (1) |
|
|
51 | (2) |
|
Chapter 4 Introducing IoC and DI in Spring |
|
|
53 | (60) |
|
Inversion of Control and Dependency Injection |
|
|
54 | (1) |
|
Types of Inversion of Control |
|
|
54 | (7) |
|
|
54 | (1) |
|
Contextualized Dependency Lookup |
|
|
55 | (2) |
|
Constructor Dependency Injection |
|
|
57 | (1) |
|
Setter Dependency Injection |
|
|
57 | (1) |
|
|
58 | (1) |
|
Setter Injection vs. Constructor Injection |
|
|
59 | (2) |
|
Inversion of Control in Spring |
|
|
61 | (1) |
|
Dependency Injection with Spring |
|
|
62 | (3) |
|
|
62 | (1) |
|
BeanFactory Implementations |
|
|
63 | (2) |
|
|
65 | (1) |
|
Configuring ApplicationContext |
|
|
65 | (42) |
|
Spring Configuration Options (XML and Java Annotations) |
|
|
65 | (1) |
|
Basic Configuration Overview |
|
|
65 | (2) |
|
Declare Spring Components |
|
|
67 | (3) |
|
|
70 | (2) |
|
Using Constructor Injection |
|
|
72 | (2) |
|
Avoiding Constructor Confusion |
|
|
74 | (2) |
|
|
76 | (1) |
|
|
76 | (3) |
|
Injecting Values Using SpEL |
|
|
79 | (3) |
|
Injecting Beans in the Same XML Unit |
|
|
82 | (2) |
|
Injection and ApplicationContext Nesting |
|
|
84 | (3) |
|
Using Collections for Injection |
|
|
87 | (6) |
|
|
93 | (1) |
|
|
93 | (4) |
|
|
97 | (4) |
|
Understanding Bean Naming |
|
|
101 | (1) |
|
|
102 | (1) |
|
|
103 | (2) |
|
Choosing an Instantiation Mode |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
107 | (1) |
|
|
107 | (3) |
|
Different Modes of Autowiring |
|
|
108 | (2) |
|
|
110 | (1) |
|
|
110 | (2) |
|
|
112 | (1) |
|
Chapter 5 Spring Configuration in Detail |
|
|
113 | (68) |
|
Spring's Impact on Application Portability |
|
|
114 | (1) |
|
Bean Life-Cycle Management |
|
|
115 | (16) |
|
Hooking into Bean Creation |
|
|
116 | (1) |
|
Execute a Method When a Bean Is Created |
|
|
117 | (3) |
|
Implementing the InitializingBean Interface |
|
|
120 | (2) |
|
Using JSR-250 @PostConstruct Annotation |
|
|
122 | (1) |
|
|
123 | (1) |
|
Hooking into Bean Destruction |
|
|
123 | (1) |
|
Executing a Method When a Bean Is Destroyed |
|
|
124 | (2) |
|
Implementing the DisposableBean Interface |
|
|
126 | (2) |
|
Using JSR-250 @PreDestroy Annotation |
|
|
128 | (2) |
|
|
130 | (1) |
|
|
130 | (1) |
|
Making Your Beans "Spring Aware" |
|
|
131 | (4) |
|
Using the BeanNameAware Interface |
|
|
131 | (2) |
|
Using the ApplicationContextAware Interface |
|
|
133 | (2) |
|
|
135 | (6) |
|
Custom FactoryBean Example: The MessageDigestFactoryBean |
|
|
135 | (3) |
|
Accessing a FactoryBean Directly |
|
|
138 | (1) |
|
Using the factory-bean and factory-method Attributes |
|
|
139 | (2) |
|
JavaBeans PropertyEditors |
|
|
141 | (9) |
|
The Built-in PropertyEditors |
|
|
141 | (6) |
|
Creating a Custom PropertyEditor |
|
|
147 | (3) |
|
More Spring ApplicationContext Configuration |
|
|
150 | (9) |
|
Internationalization with MessageSource |
|
|
151 | (1) |
|
Using ApplicationContext and MessageSource |
|
|
151 | (2) |
|
|
153 | (1) |
|
Why Use ApplicationContext As a MessageSource? |
|
|
154 | (1) |
|
Using MessageSource in Stand-Alone Applications |
|
|
154 | (1) |
|
The MessageSourceResolvable Interface |
|
|
154 | (1) |
|
|
154 | (1) |
|
|
155 | (2) |
|
Considerations for Event Usage |
|
|
157 | (1) |
|
|
157 | (2) |
|
Configuration Using Java Classes |
|
|
159 | (6) |
|
ApplicationContext Configuration in Java |
|
|
159 | (6) |
|
Java or XML Configuration? |
|
|
165 | (1) |
|
|
165 | (7) |
|
An Example of Using the Spring Profiles Feature |
|
|
165 | (6) |
|
Considerations for Using Profiles |
|
|
171 | (1) |
|
Environment and PropertySource Abstraction |
|
|
172 | (4) |
|
Configuration Using JSR-330 Annotations |
|
|
176 | (3) |
|
|
179 | (2) |
|
Chapter 6 Introducing Spring AOP |
|
|
181 | (48) |
|
|
182 | (1) |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
184 | (1) |
|
|
184 | (21) |
|
|
184 | (1) |
|
|
185 | (2) |
|
|
187 | (1) |
|
|
188 | (1) |
|
|
188 | (1) |
|
About the ProxyFactory Class |
|
|
188 | (1) |
|
Creating Advice in Spring |
|
|
189 | (1) |
|
|
190 | (1) |
|
|
191 | (1) |
|
Securing Method Access Using Before Advice |
|
|
192 | (4) |
|
Creating After-Returning Advice |
|
|
196 | (3) |
|
|
199 | (3) |
|
|
202 | (2) |
|
|
204 | (1) |
|
Advisors and Pointcuts in Spring |
|
|
205 | (17) |
|
|
205 | (2) |
|
Available Pointcut Implementations |
|
|
207 | (2) |
|
Using DefaultPointcutAdvisor |
|
|
209 | (1) |
|
Creating a Static Pointcut Using StaticMethodMatcherPointcut |
|
|
209 | (3) |
|
Creating a Dynamic Pointcut Using DyanmicMethodMatcherPointcut |
|
|
212 | (2) |
|
Using Simple Name Matching |
|
|
214 | (2) |
|
Creating Pointcuts with Regular Expression |
|
|
216 | (2) |
|
Creating Pointcuts with AspectJ Pointcut Expression |
|
|
218 | (1) |
|
Creating Annotation Matching Pointcuts |
|
|
219 | (2) |
|
Convenience Advisor Implementations |
|
|
221 | (1) |
|
|
222 | (6) |
|
Using JDK Dynamic Proxies |
|
|
222 | (1) |
|
|
223 | (1) |
|
Comparing Proxy Performance |
|
|
223 | (5) |
|
|
228 | (1) |
|
|
228 | (1) |
|
Chapter 7 More Spring AOP and Annotations |
|
|
229 | (40) |
|
Advanced Use of Pointcuts |
|
|
230 | (7) |
|
Use Control Flow Pointcuts |
|
|
230 | (3) |
|
Using Composable Pointcut |
|
|
233 | (3) |
|
Composition and the Pointcut Interface |
|
|
236 | (1) |
|
|
236 | (1) |
|
Getting Started with Introductions |
|
|
237 | (8) |
|
|
237 | (3) |
|
Object Modification Detection with Introductions |
|
|
240 | (1) |
|
|
240 | (1) |
|
|
241 | (2) |
|
|
243 | (1) |
|
|
243 | (2) |
|
|
245 | (1) |
|
Framework Services for AOP |
|
|
245 | (16) |
|
Configuring AOP Declaratively |
|
|
245 | (1) |
|
|
246 | (1) |
|
ProxyFactoryBean in Action |
|
|
246 | (3) |
|
Using ProxyFactoryBean for Introductions |
|
|
249 | (2) |
|
|
251 | (1) |
|
|
251 | (5) |
|
Using @AspectJ-Style Annotations |
|
|
256 | (4) |
|
Considerations for Declarative Spring AOP Configuration |
|
|
260 | (1) |
|
|
261 | (6) |
|
|
261 | (1) |
|
|
262 | (5) |
|
AOP in the Sample Application |
|
|
267 | (1) |
|
Filtering Obscenities in SpringBlog |
|
|
267 | (1) |
|
The BlogPosting Interface |
|
|
267 | (1) |
|
Implementing ObscenityFilter |
|
|
268 | (1) |
|
|
268 | (1) |
|
|
268 | (1) |
|
Chapter 8 Spring JDBC Support |
|
|
269 | (48) |
|
Sample Data Model for Example Code |
|
|
270 | (4) |
|
Exploring the JDBC Infrastructure |
|
|
274 | (5) |
|
Spring JDBC Infrastructure |
|
|
279 | (5) |
|
Overview and Used Packages |
|
|
279 | (1) |
|
Database Connections and DataSources |
|
|
280 | (3) |
|
Embedded Database Support |
|
|
283 | (1) |
|
Using DataSources in DAO Classes |
|
|
284 | (2) |
|
|
286 | (1) |
|
|
287 | (7) |
|
Initializing JdbcTemplate in a DAO Class |
|
|
287 | (1) |
|
Retrieving Single-Value-Use JdbcTemplate Class |
|
|
288 | (2) |
|
Using Named Parameters with NamedParameterJdbcTemplate |
|
|
290 | (1) |
|
Retrieving Domain Objects with RowMapper<T> |
|
|
291 | (1) |
|
Retrieving Nested Domain Objects with ResultSetExtractor |
|
|
292 | (2) |
|
Spring Classes That Model JDBC Operations |
|
|
294 | (20) |
|
Setting Up JDBC DAO Using Annotations |
|
|
295 | (4) |
|
Querying Data Using MappingSqlQuery<T> |
|
|
299 | (4) |
|
Updating Data Using SqlUpdate |
|
|
303 | (2) |
|
Inserting Data and Retrieving the Generated Key |
|
|
305 | (3) |
|
Batching Operations with BatchSqlUpdate |
|
|
308 | (3) |
|
Calling Stored Functions Using SqlFunction |
|
|
311 | (3) |
|
Using the Java Configuration |
|
|
314 | (1) |
|
Spring Data Project: JDBC Extensions |
|
|
315 | (1) |
|
Considerations for Using JDBC |
|
|
316 | (1) |
|
|
316 | (1) |
|
Chapter 9 Using Hibernate in Spring |
|
|
317 | (28) |
|
Create a Hibernate Utility Project in STS |
|
|
318 | (3) |
|
Sample Data Model for Example Code |
|
|
321 | (2) |
|
Configuring Hibernate SessionFactory |
|
|
323 | (3) |
|
ORM Mapping Using Hibernate Annotations |
|
|
326 | (8) |
|
|
327 | (4) |
|
|
331 | (1) |
|
|
332 | (2) |
|
The Hibernate Session Interface |
|
|
334 | (1) |
|
Database Operations with Hibernate |
|
|
334 | (9) |
|
Query Data Using Hibernate Query Language |
|
|
335 | (1) |
|
Simple Query with Lazy Fetching |
|
|
335 | (3) |
|
Query with Associations Fetching |
|
|
338 | (2) |
|
|
340 | (1) |
|
|
341 | (1) |
|
|
342 | (1) |
|
Considerations of Using Hibernate |
|
|
343 | (1) |
|
|
344 | (1) |
|
Chapter 10 Data Access in Spring with JPA2 |
|
|
345 | (52) |
|
|
346 | (7) |
|
Creating a Simple Spring JPA Utility Project in STS |
|
|
347 | (2) |
|
Sample Data Model for Example Code |
|
|
349 | (1) |
|
Configuring JPA EntityManagerFactory |
|
|
350 | (2) |
|
ORM Mapping Using JPA Annotations |
|
|
352 | (1) |
|
Eliminating the DAO Layer |
|
|
352 | (1) |
|
Injecting EntityManager into Service Layer Classes |
|
|
352 | (1) |
|
Database Operations with JPA |
|
|
353 | (21) |
|
Query Data Using the Java Persistence Query Language |
|
|
354 | (4) |
|
Query with Untyped Results |
|
|
358 | (2) |
|
Query for a Custom Result Type with a Constructor Expression |
|
|
360 | (2) |
|
|
362 | (2) |
|
|
364 | (1) |
|
|
365 | (1) |
|
|
366 | (1) |
|
|
366 | (1) |
|
Native Query with SQL Resultset Mapping |
|
|
367 | (1) |
|
Criteria Query Using the JPA 2 Criteria API |
|
|
368 | (6) |
|
Introducing Spring Data JPA |
|
|
374 | (14) |
|
Adding Spring Data JPA Library Dependencies |
|
|
374 | (2) |
|
Database Operations Using Spring Data JPA Repository Abstraction |
|
|
376 | (5) |
|
Keeping Track of Changes on the Entity Class |
|
|
381 | (7) |
|
Keeping Entity Versions by Using Hibernate Envers |
|
|
388 | (7) |
|
Adding Hibernate Envers Dependencies |
|
|
389 | (1) |
|
Adding Tables for Entity Versioning |
|
|
389 | (1) |
|
Configuring EntityManagerFactory for Entity Versioning |
|
|
390 | (2) |
|
Coding Changes for Entity Versioning and History Retrieval |
|
|
392 | (2) |
|
Testing Entity Versioning |
|
|
394 | (1) |
|
Considerations When Using JPA |
|
|
395 | (1) |
|
Using JPA in the Sample Application |
|
|
395 | (1) |
|
|
396 | (1) |
|
Using JPA for Persistence Layer Implementation |
|
|
396 | (1) |
|
Auditing and Entity Versioning |
|
|
396 | (1) |
|
|
396 | (1) |
|
Chapter 11 Using MyBatis in Spring |
|
|
397 | (40) |
|
Getting Started with MyBatis in Spring |
|
|
397 | (6) |
|
|
398 | (1) |
|
Creating a Simple Utility Project with MyBatis Support in STS |
|
|
398 | (2) |
|
Sample Data Model for Example Code |
|
|
400 | (2) |
|
Configuring MyBatis SqlSessionFactory and MapperScannerConfigurer |
|
|
402 | (1) |
|
|
403 | (4) |
|
Mapper Interfaces and SQL Mapping Files |
|
|
404 | (2) |
|
SQL Mapping XML Configuration |
|
|
406 | (1) |
|
Database Operations with MyBatis |
|
|
407 | (27) |
|
|
407 | (1) |
|
|
407 | (4) |
|
Defining the Mapping Using MyBatis Annotations |
|
|
411 | (1) |
|
One-to-Many and Many-to-Many Selects in MyBatis |
|
|
412 | (7) |
|
Selects in MyBatis with Named Parameters |
|
|
419 | (2) |
|
Selects in MyBatis Using Dynamic SQL |
|
|
421 | (2) |
|
|
423 | (4) |
|
|
427 | (5) |
|
|
432 | (2) |
|
Considerations When Using MyBatis |
|
|
434 | (1) |
|
Using MyBatis in the Sample Application |
|
|
434 | (1) |
|
|
435 | (1) |
|
Using MyBatis for Persistence Layer Implementation |
|
|
435 | (1) |
|
Auditing and Entity Versioning |
|
|
435 | (1) |
|
|
435 | (2) |
|
Chapter 12 Designing and Implementing Spring-Based Applications |
|
|
437 | (22) |
|
|
438 | (4) |
|
|
438 | (1) |
|
|
439 | (1) |
|
Drawbacks of the Basic Factory Pattern |
|
|
440 | (1) |
|
Externally Configurable Factories |
|
|
440 | (1) |
|
Supporting Multiple Implementations Transparently |
|
|
440 | (2) |
|
Supporting Multiple Instantiation Modes |
|
|
442 | (1) |
|
Impact of Spring on Interface-Based Design |
|
|
442 | (1) |
|
Building a Domain Object Model |
|
|
442 | (4) |
|
Spring and the Domain Object Model |
|
|
442 | (1) |
|
The DOM Is Not the Same As a Value Object |
|
|
443 | (1) |
|
Why Create a Domain Object Model |
|
|
444 | (1) |
|
|
444 | (1) |
|
Database Modeling and Domain Object Modeling |
|
|
445 | (1) |
|
Modeling Domain Object Relationships |
|
|
445 | (1) |
|
To Encapsulate Behavior or Not? |
|
|
445 | (1) |
|
The SpringBlog Domain Object Model |
|
|
446 | (7) |
|
Inheritance in the SpringBlog DOM |
|
|
448 | (3) |
|
Domain Behavior in SpringBlog |
|
|
451 | (1) |
|
Domain Object Relationships |
|
|
451 | (1) |
|
Domain Object Model Summary |
|
|
452 | (1) |
|
Designing and Building the Data Access Layer |
|
|
453 | (3) |
|
Practical Design Considerations |
|
|
454 | (1) |
|
Domain Objects or Data Transfer Objects? |
|
|
454 | (1) |
|
|
455 | (1) |
|
|
455 | (1) |
|
Data Access Layer Summary |
|
|
455 | (1) |
|
Designing the Service Layer |
|
|
456 | (2) |
|
|
456 | (1) |
|
Designing Business Interfaces |
|
|
457 | (1) |
|
Service Layer Dependencies |
|
|
457 | (1) |
|
Service Object Granularity |
|
|
457 | (1) |
|
|
458 | (1) |
|
|
458 | (1) |
|
Chapter 13 Transaction Management |
|
|
459 | (36) |
|
Exploring the Spring Transaction Abstraction Layer |
|
|
460 | (2) |
|
|
460 | (1) |
|
Implementations of the PlatformTransactionManager |
|
|
461 | (1) |
|
Analyzing Transaction Properties |
|
|
462 | (3) |
|
The TransactionDefinition Interface |
|
|
462 | (2) |
|
The TransactionStatus Interface |
|
|
464 | (1) |
|
Sample Data Model and Infrastructure for Example Code |
|
|
465 | (4) |
|
Creating a Simple Spring JPA Utility Project with Dependencies |
|
|
465 | (2) |
|
Sample Data Model and Common Classes |
|
|
467 | (2) |
|
Declarative and Programmatic Transactions with Spring |
|
|
469 | (15) |
|
Using Annotations for Transaction Management |
|
|
470 | (8) |
|
Using XML Configuration for Transaction Management |
|
|
478 | (3) |
|
Using Programmatic Transactions |
|
|
481 | (3) |
|
Considerations on Transaction Management |
|
|
484 | (1) |
|
Global Transactions with Spring |
|
|
484 | (9) |
|
Infrastructure for Implementing the JTA Sample |
|
|
485 | (1) |
|
Implementing Global Transactions with JTA |
|
|
485 | (7) |
|
Considerations on Using JTA Transaction Manager |
|
|
492 | (1) |
|
|
493 | (2) |
|
Chapter 14 Validation with Type Conversion and Formatting |
|
|
495 | (28) |
|
Creating a Project in STS for Samples |
|
|
495 | (1) |
|
Spring Type Conversion System |
|
|
496 | (9) |
|
Conversion from a String Using PropertyEditors |
|
|
496 | (4) |
|
Introducing Spring 3 Type Conversion |
|
|
500 | (1) |
|
Implementing a Custom Converter |
|
|
500 | (1) |
|
Configuring ConversionService |
|
|
501 | (1) |
|
Converting Between Arbitrary Types |
|
|
502 | (3) |
|
Field Formatting in Spring 3 |
|
|
505 | (3) |
|
Implementing a Custom Formatter |
|
|
505 | (2) |
|
Configuring ConversionServiceFactoryBean |
|
|
507 | (1) |
|
|
508 | (12) |
|
Using Spring Validator Interface |
|
|
509 | (2) |
|
Using JSR-303 Bean Validation |
|
|
511 | (1) |
|
Defining Validation Constraints on Object Properties |
|
|
512 | (1) |
|
Configuring Bean Validation Support in Spring |
|
|
513 | (3) |
|
Creating a Custom Validator |
|
|
516 | (2) |
|
Using AssertTrue for Custom Validation |
|
|
518 | (1) |
|
Considerations for Custom Validation |
|
|
519 | (1) |
|
Which Validation API to Use? |
|
|
519 | (1) |
|
Validation with Type Conversion and Formatting in the Sample Application |
|
|
520 | (2) |
|
|
522 | (1) |
|
Chapter 15 Task Scheduling in Spring |
|
|
523 | (16) |
|
Create a Project in STS for the Sample Projects |
|
|
523 | (1) |
|
Task Scheduling in Spring |
|
|
524 | (10) |
|
Introducing Spring TaskScheduler Abstraction |
|
|
524 | (2) |
|
|
526 | (4) |
|
Task Scheduling Using task-namespace |
|
|
530 | (2) |
|
Task Scheduling Using Annotation |
|
|
532 | (2) |
|
Asynchronous Task Execution in Spring |
|
|
534 | (3) |
|
Task Scheduling in the Sample Application |
|
|
537 | (1) |
|
|
538 | (1) |
|
Chapter 16 Using Spring Remoting |
|
|
539 | (46) |
|
Creating the Project in STS for the Samples |
|
|
540 | (1) |
|
Implementing the Service Layer for the Samples |
|
|
541 | (10) |
|
Adding Required Dependencies for the JPA Backend |
|
|
541 | (2) |
|
|
543 | (3) |
|
|
546 | (1) |
|
Implementing and Configuring ContactService |
|
|
546 | (1) |
|
Implementing ContactService |
|
|
546 | (4) |
|
Configuring ContactService |
|
|
550 | (1) |
|
Using the Spring HTTP Invoker |
|
|
551 | (3) |
|
|
551 | (1) |
|
|
552 | (2) |
|
|
554 | (8) |
|
|
555 | (2) |
|
Implementing a JMS Listener in Spring |
|
|
557 | (2) |
|
Sending JMS Messages in Spring |
|
|
559 | (3) |
|
Using RESTful-WS in Spring |
|
|
562 | (20) |
|
Introducing RESTful Web Services |
|
|
562 | (1) |
|
Adding Required Dependencies for Samples |
|
|
563 | (1) |
|
The Contact RESTful Web Service |
|
|
564 | (1) |
|
Using Spring MVC to Expose RESTful Web Services |
|
|
564 | (1) |
|
|
565 | (2) |
|
Implementing the ContactController |
|
|
567 | (2) |
|
Configuring the RESTful Servlet |
|
|
569 | (3) |
|
Using curl to Test RESTful-WS |
|
|
572 | (1) |
|
Using RestTemplate to Access RESTful-WS |
|
|
573 | (4) |
|
Securing RESTful-WS with Spring Security |
|
|
577 | (4) |
|
Using JSR-303 with RESTful Web Services |
|
|
581 | (1) |
|
Remoting in the Sample Application |
|
|
582 | (1) |
|
|
583 | (2) |
|
Chapter 17 Web Applications with Spring |
|
|
585 | (78) |
|
Create Project in STS for Samples |
|
|
586 | (1) |
|
Implement the Service Layer for Samples |
|
|
587 | (6) |
|
|
587 | (1) |
|
Implementing and Configuring ContactService |
|
|
588 | (1) |
|
Implementing ContactService |
|
|
588 | (3) |
|
Configuring ContactService |
|
|
591 | (2) |
|
Introducing MVC and Spring MVC |
|
|
593 | (7) |
|
|
593 | (2) |
|
|
595 | (1) |
|
Spring MVC WebApplicationContext Hierarchy |
|
|
595 | (1) |
|
Spring MVC Request Life Cycle |
|
|
596 | (1) |
|
|
597 | (3) |
|
Create the First View in Spring MVC |
|
|
600 | (5) |
|
Configure the DispatcherServlet |
|
|
600 | (1) |
|
Implement the ContactController |
|
|
601 | (1) |
|
Implement the Contact List View |
|
|
602 | (1) |
|
Testing the Contact List View |
|
|
603 | (2) |
|
Spring MVC Project Structure Overview |
|
|
605 | (2) |
|
i18n (Internationalization) |
|
|
607 | (3) |
|
Configure i18n in DispatcherServlet Configuration |
|
|
607 | (1) |
|
Modify the Contact List View for i18n Support |
|
|
608 | (2) |
|
|
610 | (9) |
|
|
611 | (2) |
|
View Templating with Apache Tiles |
|
|
613 | (1) |
|
|
613 | (1) |
|
Implement Page Layout Components |
|
|
614 | (3) |
|
Configure Tiles in Spring MVC |
|
|
617 | (2) |
|
Implement the Views for Contact Information |
|
|
619 | (14) |
|
Mapping of URLs to the Views |
|
|
619 | (1) |
|
Implementing the Show Contact View |
|
|
620 | (3) |
|
Implementing the Edit Contact View |
|
|
623 | (6) |
|
Implementing the Add Contact View |
|
|
629 | (1) |
|
Enable JSR-303 Bean Validation |
|
|
630 | (3) |
|
Using jQuery and jQuery UI |
|
|
633 | (12) |
|
Introducing jQuery and jQuery UI |
|
|
634 | (1) |
|
Enable jQuery and jQuery UI in a View |
|
|
634 | (2) |
|
Rich-Text Editing with CKEditor |
|
|
636 | (3) |
|
Data Grid with Pagination using jqGrid |
|
|
639 | (1) |
|
Enable jqGrid in the Contact List View |
|
|
639 | (2) |
|
Enable Pagination on the Server Side |
|
|
641 | (4) |
|
|
645 | (6) |
|
Configuring File Upload Support |
|
|
646 | (1) |
|
Modify Views for File Upload Support |
|
|
647 | (1) |
|
Modify Controller for File Upload Support |
|
|
648 | (3) |
|
Securing a Web Application with Spring Security |
|
|
651 | (7) |
|
Configuring Spring Security |
|
|
652 | (1) |
|
Adding Login Functions to the Application |
|
|
653 | (4) |
|
Using Annotations to Secure Controller Methods |
|
|
657 | (1) |
|
Support for Servlet 3 Code-Based Configuration |
|
|
658 | (2) |
|
Spring MVC in the Sample Application |
|
|
660 | (2) |
|
MVC Implementation for SpringBlog |
|
|
660 | (1) |
|
Rich User Interface and Ajax |
|
|
661 | (1) |
|
|
661 | (1) |
|
|
661 | (1) |
|
|
662 | (1) |
|
Chapter 18 Spring Web Flow and JSF |
|
|
663 | (44) |
|
Project for Sample Backend |
|
|
663 | (3) |
|
The Sample Backend Service Layer |
|
|
664 | (1) |
|
Import the Sample Backend in STS |
|
|
664 | (2) |
|
Introducing Spring Web Flow |
|
|
666 | (3) |
|
|
667 | (1) |
|
|
668 | (1) |
|
|
669 | (3) |
|
|
670 | (1) |
|
|
670 | (1) |
|
|
670 | (1) |
|
|
671 | (1) |
|
The Sample Spring Web Flow Application |
|
|
672 | (3) |
|
Design of the Sample Flow |
|
|
672 | (1) |
|
|
673 | (2) |
|
Spring Web Flow and JSF Configuration |
|
|
675 | (5) |
|
Adding Required Dependencies |
|
|
675 | (1) |
|
|
675 | (1) |
|
Configuring Web Deployment Descriptor |
|
|
676 | (2) |
|
Configuring Spring Web Flow and Spring MVC |
|
|
678 | (2) |
|
Implementing the Sample Flow |
|
|
680 | (15) |
|
Define the Flow Definition |
|
|
680 | (4) |
|
Implementing the Template Page |
|
|
684 | (1) |
|
Implementing a Custom Converter |
|
|
685 | (1) |
|
Implementing the Controller and Backing Bean |
|
|
686 | (6) |
|
Implementing the Show Contact View |
|
|
692 | (3) |
|
Implement the Add Contact Flow |
|
|
695 | (11) |
|
Step 1 Enter Basic Information |
|
|
695 | (3) |
|
Support of JSR-303 Bean Validation |
|
|
698 | (1) |
|
|
699 | (2) |
|
Step 3 Review Information |
|
|
701 | (2) |
|
Step 4 Add Contact Complete |
|
|
703 | (3) |
|
|
706 | (1) |
|
Chapter 19 Spring Testing |
|
|
707 | (30) |
|
Project for Sample Web Application |
|
|
708 | (2) |
|
Import the Sample Backend in STS |
|
|
708 | (2) |
|
Introducing an Enterprise Testing Framework |
|
|
710 | (3) |
|
Implementing Logic Unit Test |
|
|
713 | (6) |
|
Adding Required Dependencies |
|
|
713 | (1) |
|
Unit Testing Spring MVC Controller |
|
|
713 | (1) |
|
Implement the Infrastructure Classes |
|
|
714 | (1) |
|
Testing the list() Method |
|
|
715 | (2) |
|
Testing the create() Method |
|
|
717 | (2) |
|
Implementing an Integration Unit Test |
|
|
719 | (10) |
|
Adding Required Dependencies |
|
|
719 | (1) |
|
Configuring the Profile for Service Layer Testing |
|
|
719 | (2) |
|
Implementing the Infrastructure Classes |
|
|
721 | (1) |
|
Implementing Custom TestExecutionListener |
|
|
721 | (3) |
|
Implementing the Configuration Class |
|
|
724 | (1) |
|
Implementing the Base Test Class |
|
|
725 | (1) |
|
Unit Testing Service Layer |
|
|
726 | (3) |
|
Implementing a Frontend Unit Test |
|
|
729 | (4) |
|
Adding Required Dependencies |
|
|
729 | (1) |
|
|
729 | (1) |
|
Implementing a Test Case for a Frontend UI |
|
|
730 | (3) |
|
Verifying Test Case Code Coverage |
|
|
733 | (2) |
|
|
735 | (2) |
|
Chapter 20 Spring Projects: Batch, Integration, and Roo |
|
|
737 | (38) |
|
Project for Chapter Samples |
|
|
738 | (1) |
|
Import the Sample Backend in STS |
|
|
738 | (1) |
|
|
739 | (5) |
|
Batch Job Flow and Process |
|
|
739 | (1) |
|
Spring Batch Infrastructure Components |
|
|
740 | (1) |
|
|
741 | (2) |
|
|
743 | (1) |
|
|
744 | (11) |
|
Adding Required Dependencies |
|
|
744 | (1) |
|
Spring Batch Infrastructure Configuration |
|
|
745 | (1) |
|
Implementing the Import Contact Job |
|
|
746 | (9) |
|
Using Spring Batch with Spring Integration |
|
|
755 | (6) |
|
Introducing Spring Integration |
|
|
755 | (1) |
|
Adding Required Dependencies |
|
|
756 | (1) |
|
Implementing the File Polling Mechanism |
|
|
757 | (4) |
|
|
761 | (13) |
|
Configure Spring Roo in STS |
|
|
762 | (1) |
|
Create a Spring Roo Project |
|
|
763 | (2) |
|
Set Up the Persistence Layer and Entity Class |
|
|
765 | (4) |
|
|
769 | (1) |
|
Set Up the Presentation Layer |
|
|
769 | (3) |
|
|
772 | (2) |
|
|
774 | (1) |
|
Spring Batch and Spring Integration in the Sample Application |
|
|
774 | (1) |
|
|
774 | (1) |
|
Chapter 21 Sample Application in Detail |
|
|
775 | (44) |
|
Setting Up the Sample Application |
|
|
776 | (8) |
|
|
776 | (4) |
|
Switching Between the MySQL and H2 Databases |
|
|
780 | (2) |
|
Switching Between the JPA and MyBatis Implementations |
|
|
782 | (2) |
|
|
784 | (9) |
|
|
784 | (1) |
|
|
785 | (1) |
|
|
786 | (1) |
|
|
787 | (1) |
|
RESTful-WS for RSS Feed of Blog Post Entries |
|
|
788 | (3) |
|
The Batch Job for Importing Blog Posts from an XML File |
|
|
791 | (2) |
|
|
793 | (7) |
|
The Web Deployment Descriptor Configuration |
|
|
793 | (3) |
|
The Spring WebApplicationContext Hierarchy |
|
|
796 | (2) |
|
The AspectJ Load-Time Weaving Configuration |
|
|
798 | (2) |
|
|
800 | (17) |
|
Service Layer Implementation |
|
|
800 | (1) |
|
JPA Service Implementation |
|
|
801 | (2) |
|
MyBatis Service Implementation |
|
|
803 | (3) |
|
Obscenity Filter Using AOP |
|
|
806 | (3) |
|
Scheduling the Job for Purging Audit Data |
|
|
809 | (1) |
|
|
810 | (1) |
|
Web Resource Files Folder Structure |
|
|
811 | (1) |
|
|
812 | (3) |
|
Type Conversion and Formatting |
|
|
815 | (2) |
|
|
817 | (2) |
|
Chapter 22 Scripting Support in Spring |
|
|
819 | (20) |
|
Project for Chapter Samples |
|
|
820 | (3) |
|
Create a Simple Spring Utility Project |
|
|
820 | (1) |
|
Installing the Groovy Plug-in for Eclipse |
|
|
821 | (2) |
|
Scripting Support in Java |
|
|
823 | (2) |
|
|
825 | (4) |
|
|
825 | (2) |
|
|
827 | (1) |
|
|
827 | (2) |
|
|
829 | (9) |
|
Adding Required Dependencies |
|
|
829 | (1) |
|
|
829 | (1) |
|
Implementing the Rule Engine |
|
|
830 | (3) |
|
Implement the Rule Factory as a Spring Refreshable Bean |
|
|
833 | (2) |
|
Testing the Age Category Rule |
|
|
835 | (3) |
|
|
838 | (1) |
|
Chapter 23 Spring Application Monitoring |
|
|
839 | (30) |
|
Project for Chapter Samples |
|
|
840 | (2) |
|
|
842 | (16) |
|
Exporting a Spring Bean to JMX |
|
|
842 | (2) |
|
Setting Up VisualVM for JMX Monitoring |
|
|
844 | (3) |
|
Monitoring Logged-In Users |
|
|
847 | (5) |
|
Monitoring Hibernate Statistics |
|
|
852 | (2) |
|
Monitoring Spring Batch Jobs |
|
|
854 | (4) |
|
Monitoring an Application with Spring Insight |
|
|
858 | (9) |
|
Introducing Spring Insight |
|
|
859 | (1) |
|
Configuring Spring Insight |
|
|
859 | (5) |
|
|
864 | (3) |
|
|
867 | (2) |
|
Appendix A SpringSource Tool Suite |
|
|
869 | (28) |
|
|
869 | (1) |
|
|
870 | (14) |
|
Installing the Stand-Alone Version of STS |
|
|
870 | (8) |
|
Installing STS to an Existing Eclipse Environment |
|
|
878 | (6) |
|
Project Setup and Dependency Management |
|
|
884 | (8) |
|
Create a Simple Spring Utility Project |
|
|
885 | (4) |
|
Dependency Management for a Project |
|
|
889 | (3) |
|
|
892 | (4) |
|
Installing STS Extensions |
|
|
893 | (1) |
|
Configuring VMware tc Server in STS |
|
|
894 | (2) |
|
|
896 | (1) |
Index |
|
897 | |