Spring JavaConfig Reference Guide

Authors

Rod Johnson, Costin Leau, Chris Beams

1.0.0.m3

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


About this document
1. Document structure
2. Target audience
3. Code conventions
Preface to the third milestone release
I. Introduction
1. Overview
1.1. What is JavaConfig?
1.2. Why JavaConfig?
1.3. Requirements
1.3.1. Runtime Environment
1.3.2. Project Dependencies
1.4. History
2. New & Noteworthy in 1.0.0.m3
2.1. AnnotationApplicationContext deprecated
2.2. Type-safety improvements
2.3. First-class support for JavaConfig in the web tier
2.4. New semantics for nested @Configuration classes
2.5. Modularization improvements with @Import
2.6. Support for externalizing string values with @ExternalValue
3. Quick start
3.1. Download JavaConfig
3.1.1. Manual download
3.1.2. Maven 2
3.2. Create bean definitions
3.3. Retrieve bean instances
3.4. Summary
II. API Reference
4. Creating and using bean definitions
4.1. @Configuration
4.2. @Bean
4.2.1. Declaring a bean
4.2.2. Using *Aware interfaces
4.2.3. Bean visibility
4.2.4. Bean scoping
4.2.4.1. Using @Bean's scope attribute
4.2.4.2. @ScopedProxy
4.2.4.3. Method injection
4.2.5. Bean naming
4.3. JavaConfigApplicationContext
4.3.1. Construction Options
4.3.1.1. Construction by class literal
4.3.1.2. Construction by base package
4.3.1.3. Post-construction configuration
4.3.2. Accessing beans with getBean()
4.3.2.1. Type-safe access
4.3.2.2. String-based access
5. Modularizing configurations
5.1. Partitioning bean definitions across multiple @Configuration classes
5.2. Referencing externally defined beans with @ExternalBean
5.3. Importing @Configuration classes with @Import
5.4. ConfigurationSupport
5.5. Externalizing values with @ExternalValue and @ResourceBundles
5.6. Nesting @Configuration classes
6. Using aspects
6.1. Embedded aspects
6.2. Reusable aspects
7. Developing web applications with JavaConfig
7.1. JavaConfigWebApplicationContext
8. Combining configuration approaches
8.1. JavaConfig and XML
8.1.1. Bootstrapping JavaConfig from XML with ConfigurationPostProcessor
8.1.1.1. Configuring configurations
III. Appendices
A. Roadmap
B. Visualizing configurations with Spring IDE
C. Maven2 POM configurations
C.1. Minimal
C.2. AOP
D. Additional resources
D.1. Core Spring documentation
D.2. Community forums
D.3. Issue tracking
D.4. SpringSource team blog
D.5. Consulting and training services