Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
spring-reference

spring-reference

Ratings: (0)|Views: 16|Likes:
Published by srinivas.nageli

More info:

Published by: srinivas.nageli on May 29, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/09/2014

pdf

text

original

 
Reference Documentation
Version 1.2.6
(Work in progress)
Copyright (c) 2004-2005 Rod Johnson, Juergen Hoeller, Alef Arendsen, Colin Sampaleanu,Rob Harrop, Thomas Risberg, Darren Davison, Dmitriy Kopylenko, Mark Pollack, ThierryTemplier, Erwin Vervaet
Copies of this document may be made for your own use and for distribution to others, provided that you do notcharge any fee for such copies and further provided that each copy contains this Copyright Notice, whetherdistributed in print or electronically.
 
Table of Contents
Preface ................................................................................................................................................
1. Introduction
..................................................................................................................................1.1. Overview............................................................................................................................. 11.2. Usage scenarios.................................................................................................................... 2
2. Background information
...............................................................................................................2.1. Inversion of Control / Dependency Injection.......................................................................... 5
3. Beans, BeanFactory and the ApplicationContext
..........................................................................3.1. Introduction......................................................................................................................... 63.2. BeanFactory and BeanDefinitions - the basics........................................................................ 63.2.1. The BeanFactory....................................................................................................... 63.2.2. The BeanDefinition................................................................................................... 83.2.3. The bean class........................................................................................................... 83.2.4. The bean identifiers (id andname)............................................................................................................................ 103.2.5. To singleton or not to singleton.................................................................................. 103.3. Properties, collaborators, autowiring and dependencychecking.................................................................................................................................. 113.3.1. Setting bean properties and collaborators.................................................................... 113.3.2. Constructor Argument Resolution............................................................................... 143.3.3. Bean properties and constructor arguments detailed..................................................... 153.3.4. Method Injection....................................................................................................... 193.3.5. Using depends-on...................................................................................................... 213.3.6. Autowiring collaborators............................................................................................ 223.3.7. Checking for dependencies......................................................................................... 233.4. Customizing the nature of a bean........................................................................................... 233.4.1. Lifecycle interfaces................................................................................................... 243.4.2. Knowing who you are................................................................................................ 253.4.3. FactoryBean.............................................................................................................. 263.5. Abstract and child bean definitions........................................................................................ 263.6. Interacting with the BeanFactory........................................................................................... 273.6.1. Obtaining a FactoryBean, not its product..................................................................... 283.7. Customizing beans with BeanPostProcessors......................................................................... 283.8. Customizing bean factories with BeanFactoryPostProcessors.................................................. 283.8.1. The PropertyPlaceholderConfigurer............................................................................ 293.8.2. The PropertyOverrideConfigurer................................................................................ 303.9. Registering additional custom PropertyEditors....................................................................... 303.10. Using the alias element to add aliases for existing beans....................................................... 313.11. Introduction to the ApplicationContext................................................................................ 323.12. Added functionality of theApplicationContext.................................................................................................................. 323.12.1. Using the MessageSource......................................................................................... 323.12.2. Propagating events................................................................................................... 333.12.3. Low-level resources and the application context........................................................ 343.13. Customized behavior in the ApplicationContext................................................................... 353.13.1. ApplicationContextAware markerinterface........................................................................................................................ 353.13.2. The BeanPostProcessor............................................................................................ 353.13.3. The BeanFactoryPostProcessor................................................................................. 35Spring Framework Version 1.2.6 ii
 
3.13.4. The PropertyPlaceholderConfigurer.......................................................................... 363.14. Registering additional custom PropertyEditors..................................................................... 363.15. Setting a bean property or constructor arg from a propertyexpression............................................................................................................................... 373.16. Setting a bean property or constructor arg from a fieldvalue....................................................................................................................................... 383.17. Invoking another method and optionally using the returnvalue....................................................................................................................................... 383.18. Importing Bean Definitions from One File Into Another....................................................... 393.19. Creating an ApplicationContext from a web application........................................................ 403.20. Glue code and the evil singleton.......................................................................................... 413.20.1. Using SingletonBeanFactoryLocator andContextSingletonBeanFactoryLocator............................................................................. 41
4. Abstracting Access to Low-Level Resources
..................................................................................4.1. Overview............................................................................................................................. 434.2. The Resource interface......................................................................................................... 434.3. Built-in Resource implementations........................................................................................ 444.3.1. UrlResource.............................................................................................................. 444.3.2. ClassPathResource.................................................................................................... 444.3.3. FileSystemResource.................................................................................................. 454.3.4. ServletContextResource............................................................................................. 454.3.5. InputStreamResource................................................................................................. 454.3.6. ByteArrayResource................................................................................................... 454.4. The ResourceLoader Interface............................................................................................... 454.5. The ResourceLoaderAware interface..................................................................................... 464.6. Setting Resources as properties............................................................................................. 464.7. Application contexts and Resource paths............................................................................... 474.7.1. Constructing application contexts............................................................................... 474.7.2. The classpath*: prefix................................................................................................ 474.7.3. Unexpected application context handling of FileSystemResourceabsolute paths................................................................................................................ 48
5. PropertyEditors, data binding, validation and the BeanWrapper
.................................................5.1. Introduction......................................................................................................................... 505.2. Binding data using the DataBinder........................................................................................ 505.3. Bean manipulation and the BeanWrapper............................................................................... 505.3.1. Setting and getting basic and nested properties............................................................ 515.3.2. Built-in PropertyEditors, convertingtypes............................................................................................................................. 525.3.3. Other features worth mentioning................................................................................. 545.4. Validation using Spring's Validator interface.......................................................................... 545.5. The Errors interface.............................................................................................................. 555.6. Resolving codes to error messages......................................................................................... 55
6. Spring AOP: Aspect Oriented Programming with Spring
.............................................................6.1. Concepts.............................................................................................................................. 566.1.1. AOP concepts........................................................................................................... 566.1.2. Spring AOP capabilities and goals.............................................................................. 576.1.3. AOP Proxies in Spring............................................................................................... 586.2. Pointcuts in Spring............................................................................................................... 586.2.1. Concepts................................................................................................................... 596.2.2. Operations on pointcuts............................................................................................. 596.2.3. Convenience pointcut implementations....................................................................... 606.2.4. Pointcut superclasses................................................................................................. 61Spring - Java/J2EE Application Framework Spring Framework Version 1.2.6 iii

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->