Spring.in.Action第四版——英文
Springinaction
FOURTHEDITION
CRAIGWALLS
MANNING
SHELTERISLAND
ForonlineinformationandorderingofthisandotherManningbooks,pleasevisit
www.manning.com.thepublisheroffersdiscountsonthisbookwhenorderedinquantity
Formoreinformation,pleasecontact
SpecialsalesDepartment
Manningpublicationsco
20Baldwinroad
POBox761
Shelterisland.ny11964
Email:orders@manning.com
@2015byManningPublicationsCo.Allrightsreserved
Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmitted,in
anyformorbymeanselectronic,mechanical,photocopying,orotherwise,withoutpriorwritten
permissionofthepublisher:
Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsare
claimedastrademarks.Wherethosedesignationsappearinthebook,andmanning
Publicationswasawareofatrademarkclaim,thedesignationshavebeenprintedininitialcaps
orallcaps
oRecognizingtheimportanceofpreservingwhathasbeenwritten,itisManning,'spolicytohave
thebookswepublishprintedonacid-freepaperandweexertourbesteffortstothatend
Recognizingalsoourresponsibilitytoconservetheresourcesofourplanet,Manningbook
areprintedonpaperthatisatleast15percentrecycledandprocessedwithouttheuseof
elementalchlorine
Manningpublicationsco
Developmenteditor:CynthiaKane
20Baldwinroad
Copyeditor:Andycarroll
Shelterisland.ny11964
Proofreader:Alysonbrener
Typesetter:Dottiemarsico
Coverdesigner:MarijaTudor
ISBN9781617291203
Printedintheunitedstatesofamerica
12345678910-EBM-191817161514
briefcontents
PARTICORESPRING
1Springingintoaction3
2■Wiringbeans32
3■Advancedwiring64
Aspect-orientedSpring97
PART2SPRINGONTHEWEB.....................129
5Buildingspringwebapplications131
6Renderingwebviews164
7AdvancedSpringMvc194
8WorkingwithSpringWebFlow219
9Securingwebapplications244
PART3SPRINGINTHEBACKEND...............279
10HittingthedatabasewithSpringandjDbc281
1Persistingdatawithobject-relationalmal
apping305
12WorkingwithnosQldatabases327
13■Cachingdata362
14
Securingmethods379
BRIEFCONTENTS
PART4INTEGRATINGSPRING.....391
15
Workingwithremoteservices393
6CreatingRESTAPIswithSpringMvC416
17MessaginginSpring452
8MessagingwithWebSocketandSTOMP485
9SendingemailwithSpring511
20ManagingSpringbeanswithJMX523
21SimplifyingSpringdevelopmentwithSpringBoot540
contents
prefacexvii
acknowledgmentsxix
aboutthisbookxxi
PART1CORESPRING
e●@●●。0●●●●@●@●●●。。●●●●@●0●●●●●
springingintoaction3
1.1SimplifyingJavadevelopment4
UnleashingthepowerofPoos5"Injectingdependencies
Applyingaspects11.Eliminatingboilerplatecodewith
temp
16
1.2Containingyourbeans18
Workingwithanapplicationcontext19.Abean'slife20
1.8Surveyingthespringlandscape21
Springmodules22.Thespringportfolio24
1.4What'snewinSpring27
Whatwasnewinspring3.1?27.Whatwasnewin
Spring3.2:28What'snewinspring4.0?29
5Summary30
CONTENTS
Wiringbeans32
2.1ExploringSpringsconfigurationoptions88
2.2Automaticallywiringbeans34
Creatingdiscoverablebeans34.Namingacomponent-scanned
bean38.Settingabasepackageforcomponentscanning38
Annotatingbeanstobeautomaticallywired39.verifying
automaticconfiguration41
2.8WiringbeanswithJava48
Creatingaconfigurationclass43.Declaringasimple
bean44InjectingwithJavaConfig45
2.4WiringbeanswithXML46
CreatinganXMLconfigurationspecification47.Declaringa
simple48"Initializingabeanwithconstructor
injection49-Settingproperties54
2.5Importingandmixingconfigurations59
ReferencingXMLconfigurationinJavaConfig59
ReferencingJavaConfiginXMLconfiguration61
2.6Summary63
Advancedwiring64
3.1Environmentsandprofiles64
Configuringprofilebeans66.Activatingprofiles70
3.2Conditionalbeans72
8.8Addressingambiguityinautowiring75
Designatingaprimarybean76.Qualifyingautowired
beans77
3.Scopingbeans81
Workingwithrequestandsessionscope82.Declaringscoped
proxiesinXML84
3.5Runtimevalueinjection84
Injectingexternalvalues85.Wiringwiththespring
ExpressionLanguage89
3.6Summary95
Aspect-orientedSpring97
4.1Whatisaspect-orientedprogramming?98
DefiningAoPterminology99.Spring'sAOPsupport101
CONTENTS
4.2Selectingjoinpointswithpointcuts108
Writingpointcuts104Selectingbeansinpointcuts106
4.3Creatingannotatedaspects106
Defininganaspect106Creatingaroundadvice110
Handlingparametersinadvice112Annotating
introductions115
4.4DeclaringaspectsinXML117
Declaringbeforeandafteradvice118Declaringaround
advice121Passingparameterstoadvice122
Introducingnewfunctionalitywithaspects124
4.5InjectingAspectaspects125
4.6Summary127
PART2SPRINGONTHEWEB
129
BuildingSpringwebapplications131
5.1GettingstartedwithSpringmvc132
Followingthelifeofarequest132Settingupsp
MVC134.Introducingthespittrapplication138
5.2Writingasimplecontroller139
Testingthecontroller140:Definingclass-levelrequest
handling142Passingmodeldatatotheview143
5.8Acceptingrequestinput148
Takingqueryparameters149-Takinginputviapath
151
5.Processingforms154
Writingaform-handlingcontroller156.Validatingforms159
5.5Sumr
162
Renderingwebviews164
6.1Understandingviewresolution164
6.2CreatingJSPviews167
ConfiguringaySP-readyviewresolver167.UsingSpring'sSF
libraries169
6.3DefiningalayoutwithapacheTilesviews182
ConfiguringaTilesviewresolver182
用户评论