3.4.4. The other scopes ................................................................................................ 60
3.4.5. Custom scopes .................................................................................................. 64
3.5. Customizing the nature of a bean ................................................................................... 66
3.5.1. Lifecycle interfaces ........................................................................................... 66
3.5.2. Knowing who you are ........................................................................................ 69
3.6. Bean definition inheritance ........................................................................................... 71
3.7. Container extension points ............................................................................................ 72
3.7.1. Customizing beans using BeanPostProcessors ................................................... 72
3.7.2. Customizing configuration metadata with BeanFactoryPostProcessors ............... 75
3.7.3. Customizing instantiation logic using FactoryBeans ............................................ 78
3.8. The ApplicationContext ............................................................................................. 78
3.8.1. Internationalization using MessageSources ......................................................... 79
3.8.2. Events ............................................................................................................... 81
3.8.3. Convenient access to low-level resources ............................................................ 83
3.8.4. Convenient ApplicationContext instantiation for web applications ..................... 83
3.9. Glue code and the evil singleton .................................................................................... 84
3.9.1. Using the Singleton-helper classes ...................................................................... 85
4. Resources .............................................................................................................................. 86
4.1. Introduction ................................................................................................................. 86
4.2. The Resource interface ................................................................................................. 86
4.3. Built-in Resource implementations ............................................................................... 87
4.3.1. UrlResource ..................................................................................................... 87
4.3.2. ClassPathResource ........................................................................................... 87
4.3.3. FileSystemResource ......................................................................................... 88
4.3.4. ServletContextResource .................................................................................. 88
4.3.5. InputStreamResource ....................................................................................... 88
4.3.6. ByteArrayResource ........................................................................................... 88
4.4. The ResourceLoader .................................................................................................... 88
4.5. The ResourceLoaderAware interface ............................................................................. 89
4.6. Resources as dependencies ........................................................................................... 90
4.7. Application contexts and Resource paths ....................................................................... 90
4.7.1. Constructing application contexts ....................................................................... 90
4.7.2. Wildcards in application context constructor resource paths ................................. 91
4.7.3. FileSystemResource caveats ............................................................................. 93
5. Validation, Data-binding, the BeanWrapper, and PropertyEditors ......................................... 95
5.1. Introduction ................................................................................................................. 95
5.2. Validation using Spring's Validator interface ................................................................ 95
5.3. Resolving codes to error messages ................................................................................. 97
5.4. Bean manipulation and the BeanWrapper ........................................................................ 97
5.4.1. Setting and getting basic and nested properties .................................................... 97
5.4.2. Built-in PropertyEditor implementations ............................................................. 99
6. Aspect Oriented Programming with Spring .......................................................................... 105
6.1. Introduction ................................................................................................................. 105
6.1.1. AOP concepts ................................................................................................... 105
6.1.2. Spring AOP capabilities and goals ...................................................................... 107
6.1.3. AOP Proxies ..................................................................................................... 108
6.2. @AspectJ support ........................................................................................................ 108
6.2.1. Enabling @AspectJ Support ............................................................................... 108
6.2.2. Declaring an aspect ............................................................................................ 109
6.2.3. Declaring a pointcut ........................................................................................... 109
6.2.4. Declaring advice ................................................................................................ 114
6.2.5. Introductions ..................................................................................................... 119
The Spring Framework - Reference Documentation
Spring Framework (2.0.7) iii