没有合适的资源?快使用搜索试试~ 我知道了~
spring2.5-英文文档1
需积分: 0 0 下载量 156 浏览量
2022-08-04
16:05:57
上传
评论
收藏 4.27MB PDF 举报
温馨提示
试读
583页
spring2.5-英文文档1
资源详情
资源评论
资源推荐
The Spring Framework - Reference Documentation
Version 2.5.1
Copyright © 2004-2007 Rod Johnson, Juergen Hoeller, Alef Arendsen, Colin Sampaleanu,
Rob Harrop, Thomas Risberg, Darren Davison, Dmitriy Kopylenko, Mark Pollack, Thierry
Templier, Erwin Vervaet, Portia Tung, Ben Hale, Adrian Colyer, John Lewis, Costin Leau,
Mark Fisher, Sam Brannen, Ramnivas Laddad
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.
Preface................................................................................................................................................xv
1.Introduction...................................................................................................................................16
1.1.Overview..............................................................................................................................16
1.2.Usagescenarios ....................................................................................................................18
2.What'snewinSpring2.0and2.5? ................................................................................................. 21
2.1.Introduction..........................................................................................................................21
2.2.TheInversionofControl(IoC)container ................................................................................ 21
2.2.1.Newbeanscopes ........................................................................................................21
2.2.2.EasierXMLconfiguration...........................................................................................21
2.2.3.ExtensibleXMLauthoring ..........................................................................................22
2.2.4.Annotation-drivenconfiguration..................................................................................22
2.2.5.Autodetectingcomponentsintheclasspath ..................................................................22
2.3.AspectOrientedProgramming(AOP) ....................................................................................22
2.3.1.EasierAOPXMLconfiguration ..................................................................................23
2.3.2.Supportfor@AspectJaspects .....................................................................................23
2.3.3.Supportforbeannamepointcutelement ...................................................................... 23
2.3.4.SupportforAspectJload-timeweaving ........................................................................23
2.4.TheMiddleTier ....................................................................................................................23
2.4.1.EasierconfigurationofdeclarativetransactionsinXML ............................................... 23
2.4.2.FullWebSpheretransactionmanagementsupport .........................................................23
2.4.3.JPA ...........................................................................................................................24
2.4.4.AsynchronousJMS.....................................................................................................24
2.4.5.JDBC ........................................................................................................................24
2.5.TheWebTier........................................................................................................................25
2.5.1.SensibledefaultinginSpringMVC .............................................................................25
2.5.2.Portletframework.......................................................................................................25
2.5.3.Annotation-basedcontrollers.......................................................................................25
2.5.4.AformtaglibraryforSpringMVC ............................................................................. 25
2.5.5.Tiles2support ...........................................................................................................25
2.5.6.JSF1.2support ..........................................................................................................26
2.5.7.JAX-WSsupport ........................................................................................................26
2.6.Everythingelse .....................................................................................................................26
2.6.1.Dynamiclanguagesupport ..........................................................................................26
2.6.2.Enhancedtestingsupport ............................................................................................26
2.6.3.JMXsupport ..............................................................................................................26
2.6.4.Deploying a Springapplication context as JCAadapter ................................................. 27
2.6.5.Taskscheduling .........................................................................................................27
2.6.6.Java5(Tiger)support .................................................................................................27
2.7.MigratingtoSpring2.5..........................................................................................................27
2.7.1.Changes.....................................................................................................................28
2.8.Updatedsampleapplications ..................................................................................................30
2.9.Improveddocumentation .......................................................................................................30
I.CoreTechnologies............................................................................................................................31
3.TheIoCcontainer ..................................................................................................................32
3.1.Introduction..................................................................................................................32
3.2.Basics-containersandbeans .........................................................................................32
3.2.1.Thecontainer .....................................................................................................33
3.2.2.Instantiatingacontainer ......................................................................................34
3.2.3.Thebeans ..........................................................................................................35
3.2.4.Usingthecontainer.............................................................................................39
3.3.Dependencies................................................................................................................40
3.3.1.Injectingdependencies........................................................................................40
Spring Framework (2.5.1) ii
3.3.2.Dependenciesandconfigurationindetail .............................................................45
3.3.3.Usingdepends-on ..............................................................................................53
3.3.4.Lazily-instantiatedbeans.....................................................................................54
3.3.5.Autowiringcollaborators ....................................................................................55
3.3.6.Checkingfordependencies..................................................................................57
3.3.7.MethodInjection ................................................................................................57
3.4.Beanscopes ..................................................................................................................60
3.4.1.Thesingletonscope ............................................................................................61
3.4.2.Theprototypescope ...........................................................................................62
3.4.3.Singletonbeanswithprototype-beandependencies ...............................................63
3.4.4.Theotherscopes.................................................................................................64
3.4.5.Customscopes ...................................................................................................68
3.5.Customizingthenatureofabean .................................................................................... 70
3.5.1.Lifecyclecallbacks .............................................................................................70
3.5.2.Knowingwhoyouare .........................................................................................74
3.6.Beandefinitioninheritance ............................................................................................76
3.7.Containerextensionpoints .............................................................................................77
3.7.1.CustomizingbeansusingBeanPostProcessors ....................................................77
3.7.2.CustomizingconfigurationmetadatawithBeanFactoryPostProcessors ...............80
3.7.3.CustomizinginstantiationlogicusingFactoryBeans ............................................83
3.8.TheApplicationContext ..............................................................................................83
3.8.1.BeanFactoryorApplicationContext? ................................................................84
3.8.2.InternationalizationusingMessageSources ..........................................................84
3.8.3.Events ...............................................................................................................87
3.8.4.Convenientaccesstolow-levelresources .............................................................88
3.8.5.ConvenientApplicationContext instantiationforwebapplications ...................... 89
3.9.Gluecodeandtheevilsingleton ..................................................................................... 90
3.10. Deploying a Spring ApplicationContext as a J2EE RAR file .......................................... 90
3.11.Annotation-basedconfiguration....................................................................................91
3.11.1.@Autowired ......................................................................................................92
3.11.2.Fine-tuningannotation-basedautowiringwithqualifiers .....................................94
3.11.3.CustomAutowireConfigurer .............................................................................97
3.11.4.@Resource........................................................................................................97
3.11.5.@PostConstructand@PreDestroy ....................................................................98
3.12.Classpathscanningformanagedcomponents ................................................................99
3.12.1.@Component andfurtherstereotypeannotations ...................................................99
3.12.2.Auto-detectingcomponents ...............................................................................100
3.12.3.Usingfilterstocustomizescanning ....................................................................100
3.12.4.Namingauto-detectedcomponents ....................................................................101
3.12.5.Providingascopeforauto-detectedcomponents ................................................. 102
3.12.6.Providingqualifiermetadatawithannotations ....................................................102
3.13.RegisteringaLoadTimeWeaver .....................................................................................103
4.Resources...............................................................................................................................104
4.1.Introduction..................................................................................................................104
4.2.TheResourceinterface..................................................................................................104
4.3.Built-inResourceimplementations ................................................................................105
4.3.1.UrlResource ......................................................................................................105
4.3.2.ClassPathResource ...........................................................................................105
4.3.3.FileSystemResource..........................................................................................106
4.3.4.ServletContextResource...................................................................................106
4.3.5.InputStreamResource ........................................................................................106
4.3.6.ByteArrayResource ...........................................................................................106
The Spring Framework - Reference Documentation
Spring Framework (2.5.1) iii
4.4.TheResourceLoader .....................................................................................................106
4.5.TheResourceLoaderAwareinterface ..............................................................................107
4.6.Resourcesasdependencies............................................................................................108
4.7.ApplicationcontextsandResource paths ........................................................................108
4.7.1.Constructingapplicationcontexts ........................................................................108
4.7.2.Wildcardsinapplicationcontextconstructorresourcepaths .................................. 109
4.7.3.FileSystemResourcecaveats ..............................................................................111
5.Validation,Data-binding,theBeanWrapper,andPropertyEditors .......................................... 113
5.1.Introduction..................................................................................................................113
5.2.ValidationusingSpring'sValidator interface.................................................................113
5.3.Resolvingcodestoerrormessages .................................................................................115
5.4.BeanmanipulationandtheBeanWrapper ........................................................................115
5.4.1.Settingandgettingbasicandnestedproperties ..................................................... 115
5.4.2.Built-inPropertyEditorimplementations ..............................................................117
6.AspectOrientedProgrammingwithSpring ...........................................................................123
6.1.Introduction..................................................................................................................123
6.1.1.AOPconcepts ....................................................................................................123
6.1.2.SpringAOPcapabilitiesandgoals .......................................................................125
6.1.3.AOPProxies ......................................................................................................126
6.2.@AspectJsupport .........................................................................................................126
6.2.1.Enabling@AspectJSupport................................................................................126
6.2.2.Declaringanaspect.............................................................................................127
6.2.3.Declaringapointcut ...........................................................................................127
6.2.4.Declaringadvice ................................................................................................133
6.2.5.Introductions......................................................................................................139
6.2.6.Aspectinstantiationmodels.................................................................................139
6.2.7.Example ............................................................................................................140
6.3.Schema-basedAOPsupport ...........................................................................................141
6.3.1.Declaringanaspect.............................................................................................142
6.3.2.Declaringapointcut ...........................................................................................142
6.3.3.Declaringadvice ................................................................................................143
6.3.4.Introductions......................................................................................................148
6.3.5.Aspectinstantiationmodels.................................................................................149
6.3.6.Advisors ............................................................................................................149
6.3.7.Example ............................................................................................................149
6.4.ChoosingwhichAOPdeclarationstyletouse ................................................................. 151
6.4.1.SpringAOPorfullAspectJ? ...............................................................................151
6.4.2.@AspectJorXMLforSpringAOP? .................................................................... 151
6.5.Mixingaspecttypes.......................................................................................................152
6.6.Proxyingmechanisms....................................................................................................152
6.6.1.UnderstandingAOPproxies ................................................................................153
6.7.Programmaticcreationof@AspectJProxies ...................................................................155
6.8.UsingAspectJwithSpringapplications ..........................................................................156
6.8.1. Using AspectJ to dependency inject domain objects with Spring ............................ 156
6.8.2.OtherSpringaspectsforAspectJ .........................................................................159
6.8.3.ConfiguringAspectJaspectsusingSpringIoC ..................................................... 159
6.8.4.Load-time weaving withAspectJ in the SpringFramework ................................... 160
6.9.FurtherResources .........................................................................................................167
7.SpringAOPAPIs ...................................................................................................................168
7.1.Introduction..................................................................................................................168
7.2.PointcutAPIinSpring ...................................................................................................168
7.2.1.Concepts............................................................................................................168
The Spring Framework - Reference Documentation
Spring Framework (2.5.1) iv
7.2.2.Operationsonpointcuts ......................................................................................169
7.2.3.AspectJexpressionpointcuts ...............................................................................169
7.2.4.Conveniencepointcutimplementations ................................................................169
7.2.5.Pointcutsuperclasses ..........................................................................................171
7.2.6.Custompointcuts................................................................................................171
7.3.AdviceAPIinSpring ....................................................................................................171
7.3.1.Advicelifecycles ................................................................................................171
7.3.2.AdvicetypesinSpring ........................................................................................172
7.4.AdvisorAPIinSpring ...................................................................................................177
7.5.UsingtheProxyFactoryBeantocreateAOPproxies ........................................................ 177
7.5.1.Basics................................................................................................................177
7.5.2.JavaBeanproperties............................................................................................178
7.5.3.JDK-andCGLIB-basedproxies ..........................................................................179
7.5.4.Proxyinginterfaces.............................................................................................180
7.5.5.Proxyingclasses .................................................................................................181
7.5.6.Using'global'advisors ........................................................................................182
7.6.Conciseproxydefinitions ..............................................................................................182
7.7.CreatingAOPproxiesprogrammaticallywiththeProxyFactory ....................................... 183
7.8.Manipulatingadvisedobjects .........................................................................................184
7.9.Usingthe"autoproxy"facility ........................................................................................185
7.9.1.Autoproxybeandefinitions .................................................................................185
7.9.2.Usingmetadata-drivenauto-proxying ..................................................................187
7.10.UsingTargetSources ...................................................................................................189
7.10.1.Hotswappabletargetsources.............................................................................189
7.10.2.Poolingtargetsources .......................................................................................190
7.10.3.Prototypetargetsources ....................................................................................191
7.10.4.ThreadLocaltargetsources ...............................................................................191
7.11.DefiningnewAdvicetypes ..........................................................................................192
7.12.Furtherresources.........................................................................................................192
8.Testing ...................................................................................................................................193
8.1.Introduction..................................................................................................................193
8.2.Unittesting ...................................................................................................................193
8.2.1.Mockobjects......................................................................................................193
8.2.2.Unittestingsupportclasses .................................................................................194
8.3.Integrationtesting .........................................................................................................194
8.3.1.Overview...........................................................................................................194
8.3.2.Whichsupportframeworktouse .........................................................................195
8.3.3.Commongoals ...................................................................................................195
8.3.4.JDBCtestingsupport ..........................................................................................197
8.3.5.Commonannotations ..........................................................................................197
8.3.6.JUnit3.8legacysupport......................................................................................199
8.3.7.SpringTestContextFramework ...........................................................................203
8.3.8.PetClinicexample ..............................................................................................213
8.4.FurtherResources .........................................................................................................214
II.MiddleTierDataAccess..................................................................................................................216
9.Transactionmanagement .......................................................................................................217
9.1.Introduction..................................................................................................................217
9.2.Motivations ..................................................................................................................217
9.3.Keyabstractions............................................................................................................219
9.4.Resourcesynchronizationwithtransactions ....................................................................221
9.4.1.High-levelapproach ...........................................................................................222
9.4.2.Low-levelapproach ............................................................................................222
The Spring Framework - Reference Documentation
Spring Framework (2.5.1) v
剩余582页未读,继续阅读
陈游泳
- 粉丝: 29
- 资源: 302
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- kouzhao-main-pycharm官网
- 太原理工大学在项目管理方面涉及多个领域和层面 以下是对太原理工大学项目管理的一些概述: 实验室建设项目管理:太原理工大学制定了
- python 数据分析示例
- 一分钟计数绷踢.mp4
- intel-visual-fortran-xe2011.zip
- tensorflow-gpu-2.5.3-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-gpu-2.2.1-cp35-cp35m-win-amd64.whl
- 2023-04-06-项目笔记 - 第一百三十五阶段 - 4.4.2.133全局变量的作用域-133 -2024.05.16
- tensorflow-gpu-2.5.3-cp38-cp38-manylinux2010-x86-64.whl
- nginx/1.25.4 with rtmp
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0