没有合适的资源?快使用搜索试试~ 我知道了~
首页"Spring Framework 4.1.9官方文档全面解析"
"Spring Framework 4.1.9官方文档全面解析"
需积分: 1 4 下载量 200 浏览量
更新于2023-12-25
收藏 4.92MB PDF 举报
Spring Framework Reference Documentation4.1.9.RELEASE是由Rod Johnson,Juergen Hoeller,Keith Donald,Colin Sampaleanu,Rob Harrop,Thomas Risberg,AlefArendsen,Darren Davison,Dmitriy Kopylenko,Mark Pollack,Thierry Templier,Erwin Vervaet,PortiaTung,Ben Hale,Adrian Colyer,John Lewis,Costin Leau,Mark Fisher,Sam Brannen,RamnivasLaddad,Arjen Poutsma,Chris Beams,Tareq Abedrabbo,Andy Clement,Dave Syer,Oliver Gierke,Rossen Stoyanchev,Phillip Webb,Rob Winch等多位知名作者所著的官方文档,全文共有2000字。
该文档详细介绍了Spring Framework 4.1.9版本的各项功能和特性,包括Spring框架的核心概念,IoC容器,AOP,事务管理,数据访问,Web开发,集成等内容。这些内容涵盖了Spring框架在企业应用开发中的方方面面,旨在帮助开发人员更好地理解和应用Spring框架。
在文档中,作者们通过清晰的语言和丰富的示例,深入浅出地介绍了Spring Framework 4.1.9的各项功能,并针对不同的应用场景给出了最佳实践和使用建议。无论是对Spring框架有一定了解的开发人员,还是初次接触Spring的新手,都能从中获益良多。
除了对Spring Framework各项功能的介绍外,文档还包含了大量的实际案例和最佳实践,这些案例涵盖了企业应用开发中的常见问题和解决方案,对于开发人员在实际项目中遇到的挑战提供了宝贵的经验和参考。
总的来说,Spring Framework Reference Documentation4.1.9.RELEASE是一本权威而全面的官方文档,无论是对Spring框架本身的理解,还是在实际项目中的应用,都具有重要的参考价值。它不仅是Spring开发人员的必备手册,也是企业应用开发中的指导宝典。通过学习和理解这本文档,开发人员可以更加高效地利用Spring框架来构建稳健、高性能的企业级应用系统。
Spring Framework Reference Documentation
4.1.9.RELEASE Spring Framework xvi
Theme resolvers ............................................................................................. 488
17.10. Spring’s multipart (file upload) support ........................................................... 488
Introduction .................................................................................................... 488
Using a MultipartResolver with Commons FileUpload ........................................ 488
Using a MultipartResolver with Servlet 3.0 ....................................................... 489
Handling a file upload in a form ...................................................................... 489
Handling a file upload request from programmatic clients .................................. 490
17.11. Handling exceptions ..................................................................................... 491
HandlerExceptionResolver .............................................................................. 491
@ExceptionHandler ........................................................................................ 491
Handling Standard Spring MVC Exceptions ...................................................... 492
Annotating Business Exceptions With @ResponseStatus .................................. 493
Customizing the Default Servlet Container Error Page ...................................... 493
17.12. Web Security ............................................................................................... 494
17.13. Convention over configuration support ........................................................... 494
The Controller ControllerClassNameHandlerMapping ........................................ 494
The Model ModelMap (ModelAndView) ............................................................ 495
The View - RequestToViewNameTranslator ..................................................... 497
17.14. ETag support ............................................................................................... 498
17.15. Code-based Servlet container initialization ..................................................... 498
17.16. Configuring Spring MVC ............................................................................... 500
Enabling the MVC Java Config or the MVC XML Namespace ............................ 500
Customizing the Provided Configuration ........................................................... 502
Interceptors .................................................................................................... 502
Content Negotiation ........................................................................................ 503
View Controllers ............................................................................................. 504
View Resolvers .............................................................................................. 504
Serving of Resources ..................................................................................... 506
Falling Back On the "Default" Servlet To Serve Resources ................................ 508
Path Matching ................................................................................................ 509
Advanced Customizations with MVC Java Config ............................................. 509
Advanced Customizations with the MVC Namespace ........................................ 510
18. View technologies ..................................................................................................... 511
18.1. Introduction .................................................................................................... 511
18.2. JSP & JSTL .................................................................................................. 511
View resolvers ................................................................................................ 511
Plain-old JSPs versus JSTL ............................................................................ 512
Additional tags facilitating development ............................................................ 512
Using Spring’s form tag library ........................................................................ 512
Configuration .......................................................................................... 512
The form tag .......................................................................................... 512
The input tag .......................................................................................... 514
The checkbox tag ................................................................................... 514
The checkboxes tag ............................................................................... 516
The radiobutton tag ................................................................................ 516
The radiobuttons tag ............................................................................... 516
The password tag ................................................................................... 517
The select tag ........................................................................................ 517
The option tag ........................................................................................ 517
The options tag ...................................................................................... 518
Spring Framework Reference Documentation
4.1.9.RELEASE Spring Framework xvii
The textarea tag ..................................................................................... 519
The hidden tag ....................................................................................... 519
The errors tag ........................................................................................ 519
HTTP Method Conversion ....................................................................... 521
HTML5 Tags .......................................................................................... 522
18.3. Tiles .............................................................................................................. 522
Dependencies ................................................................................................ 522
How to integrate Tiles ..................................................................................... 522
UrlBasedViewResolver ............................................................................ 523
ResourceBundleViewResolver ................................................................. 523
SimpleSpringPreparerFactory and SpringBeanPreparerFactory ................. 524
18.4. Velocity & FreeMarker .................................................................................... 524
Dependencies ................................................................................................ 525
Context configuration ...................................................................................... 525
Creating templates ......................................................................................... 525
Advanced configuration ................................................................................... 526
velocity.properties ................................................................................... 526
FreeMarker ............................................................................................. 526
Bind support and form handling ....................................................................... 527
The bind macros .................................................................................... 527
Simple binding ........................................................................................ 527
Form input generation macros ................................................................. 528
HTML escaping and XHTML compliance ................................................. 531
18.5. XSLT ............................................................................................................. 532
My First Words ............................................................................................... 532
Bean definitions ...................................................................................... 532
Standard MVC controller code ................................................................. 532
Convert the model data to XML ............................................................... 533
Defining the view properties .................................................................... 533
Document transformation ........................................................................ 534
Summary ....................................................................................................... 534
18.6. Document views (PDF/Excel) .......................................................................... 535
Introduction .................................................................................................... 535
Configuration and setup .................................................................................. 535
Document view definitions ....................................................................... 535
Controller code ....................................................................................... 535
Subclassing for Excel views .................................................................... 535
Subclassing for PDF views ..................................................................... 537
18.7. JasperReports ............................................................................................... 537
Dependencies ................................................................................................ 537
Configuration .................................................................................................. 537
Configuring the ViewResolver .................................................................. 538
Configuring the Views ............................................................................. 538
About Report Files .................................................................................. 538
Using JasperReportsMultiFormatView ...................................................... 538
Populating the ModelAndView ......................................................................... 539
Working with Sub-Reports ............................................................................... 540
Configuring Sub-Report Files .................................................................. 540
Configuring Sub-Report Data Sources ..................................................... 541
Configuring Exporter Parameters ..................................................................... 541
Spring Framework Reference Documentation
4.1.9.RELEASE Spring Framework xviii
18.8. Feed Views ................................................................................................... 542
18.9. XML Marshalling View .................................................................................... 542
18.10. JSON Mapping View .................................................................................... 543
18.11. XML Mapping View ...................................................................................... 543
19. Integrating with other web frameworks ....................................................................... 544
19.1. Introduction .................................................................................................... 544
19.2. Common configuration ................................................................................... 545
19.3. JavaServer Faces 1.2 .................................................................................... 546
SpringBeanFacesELResolver (JSF 1.2+) ......................................................... 546
FacesContextUtils ........................................................................................... 546
19.4. Apache Struts 2.x .......................................................................................... 546
19.5. Tapestry 5.x .................................................................................................. 547
19.6. Further Resources ......................................................................................... 547
20. Portlet MVC Framework ............................................................................................ 548
20.1. Introduction .................................................................................................... 548
Controllers - The C in MVC ............................................................................ 549
Views - The V in MVC .................................................................................... 549
Web-scoped beans ......................................................................................... 549
20.2. The DispatcherPortlet ..................................................................................... 549
20.3. The ViewRendererServlet ............................................................................... 551
20.4. Controllers ..................................................................................................... 552
AbstractController and PortletContentGenerator ............................................... 553
Other simple controllers .................................................................................. 554
Command Controllers ..................................................................................... 554
PortletWrappingController ................................................................................ 555
20.5. Handler mappings .......................................................................................... 555
PortletModeHandlerMapping ............................................................................ 556
ParameterHandlerMapping .............................................................................. 556
PortletModeParameterHandlerMapping ............................................................ 557
Adding HandlerInterceptors ............................................................................. 557
HandlerInterceptorAdapter ............................................................................... 558
ParameterMappingInterceptor .......................................................................... 558
20.6. Views and resolving them .............................................................................. 558
20.7. Multipart (file upload) support ......................................................................... 558
Using the PortletMultipartResolver ................................................................... 559
Handling a file upload in a form ...................................................................... 559
20.8. Handling exceptions ....................................................................................... 563
20.9. Annotation-based controller configuration ........................................................ 563
Setting up the dispatcher for annotation support ............................................... 563
Defining a controller with @Controller .............................................................. 564
Mapping requests with @RequestMapping ....................................................... 564
Supported handler method arguments ............................................................. 566
Binding request parameters to method parameters with @RequestParam .......... 568
Providing a link to data from the model with @ModelAttribute ............................ 568
Specifying attributes to store in a Session with @SessionAttributes .................... 569
Customizing WebDataBinder initialization ......................................................... 569
Customizing data binding with @InitBinder ............................................... 569
Configuring a custom WebBindingInitializer .............................................. 570
20.10. Portlet application deployment ...................................................................... 570
21. WebSocket Support .................................................................................................. 571
Spring Framework Reference Documentation
4.1.9.RELEASE Spring Framework xix
21.1. Introduction .................................................................................................... 571
WebSocket Fallback Options ........................................................................... 571
A Messaging Architecture ............................................................................... 572
Sub-Protocol Support in WebSocket ................................................................ 572
Should I Use WebSocket? .............................................................................. 572
21.2. WebSocket API ............................................................................................. 573
Create and Configure a WebSocketHandler ..................................................... 573
Customizing the WebSocket Handshake .......................................................... 574
WebSocketHandler Decoration ........................................................................ 575
Deployment Considerations ............................................................................. 575
Configuring the WebSocket Engine ................................................................. 576
Configuring allowed origins ............................................................................. 578
21.3. SockJS Fallback Options ................................................................................ 579
Overview of SockJS ....................................................................................... 579
Enable SockJS ............................................................................................... 580
HTTP Streaming in IE 8, 9: Ajax/XHR vs IFrame .............................................. 581
Heartbeat Messages ....................................................................................... 582
Servlet 3 Async Requests ............................................................................... 582
CORS Headers for SockJS ............................................................................. 583
SockJS Client ................................................................................................. 583
21.4. STOMP Over WebSocket Messaging Architecture ........................................... 585
Overview of STOMP ....................................................................................... 585
Enable STOMP over WebSocket ..................................................................... 586
Flow of Messages .......................................................................................... 588
Annotation Message Handling ......................................................................... 589
Sending Messages ......................................................................................... 590
Simple Broker ................................................................................................ 591
Full-Featured Broker ....................................................................................... 591
Connections To Full-Featured Broker .............................................................. 592
Using Dot as Separator in @MessageMapping Destinations ............................. 593
Authentication ................................................................................................. 594
User Destinations ........................................................................................... 595
Listening To ApplicationContext Events and Intercepting Messages ................... 596
WebSocket Scope .......................................................................................... 597
Configuration and Performance ....................................................................... 598
Runtime Monitoring ......................................................................................... 601
Testing Annotated Controller Methods ............................................................. 602
VI. Integration ......................................................................................................................... 603
22. Remoting and web services using Spring ................................................................... 604
22.1. Introduction .................................................................................................... 604
22.2. Exposing services using RMI .......................................................................... 605
Exporting the service using the RmiServiceExporter ......................................... 605
Linking in the service at the client ................................................................... 606
22.3. Using Hessian or Burlap to remotely call services via HTTP .............................. 606
Wiring up the DispatcherServlet for Hessian and co. ......................................... 606
Exposing your beans by using the HessianServiceExporter ............................... 607
Linking in the service on the client .................................................................. 607
Using Burlap .................................................................................................. 608
Applying HTTP basic authentication to a service exposed through Hessian or
Burlap ............................................................................................................ 608
Spring Framework Reference Documentation
4.1.9.RELEASE Spring Framework xx
22.4. Exposing services using HTTP invokers .......................................................... 608
Exposing the service object ............................................................................ 609
Linking in the service at the client ................................................................... 610
22.5. Web services ................................................................................................. 610
Exposing servlet-based web services using JAX-WS ........................................ 610
Exporting standalone web services using JAX-WS ........................................... 611
Exporting web services using the JAX-WS RI’s Spring support .......................... 612
Accessing web services using JAX-WS ........................................................... 612
22.6. JMS .............................................................................................................. 613
Server-side configuration ................................................................................. 614
Client-side configuration .................................................................................. 614
22.7. AMQP ........................................................................................................... 615
22.8. Auto-detection is not implemented for remote interfaces ................................... 615
22.9. Considerations when choosing a technology .................................................... 616
22.10. Accessing RESTful services on the Client ..................................................... 616
RestTemplate ................................................................................................. 616
Working with the URI .............................................................................. 619
Dealing with request and response headers ............................................. 620
Jackson JSON Views support ................................................................. 620
HTTP Message Conversion ............................................................................ 620
StringHttpMessageConverter ................................................................... 621
FormHttpMessageConverter .................................................................... 621
ByteArrayHttpMessageConverter ............................................................. 621
MarshallingHttpMessageConverter ........................................................... 621
MappingJackson2HttpMessageConverter ................................................. 621
MappingJackson2XmlHttpMessageConverter ........................................... 622
SourceHttpMessageConverter ................................................................. 622
BufferedImageHttpMessageConverter ...................................................... 622
Async RestTemplate ....................................................................................... 622
23. Enterprise JavaBeans (EJB) integration ..................................................................... 624
23.1. Introduction .................................................................................................... 624
23.2. Accessing EJBs ............................................................................................. 624
Concepts ........................................................................................................ 624
Accessing local SLSBs ................................................................................... 624
Accessing remote SLSBs ................................................................................ 626
Accessing EJB 2.x SLSBs versus EJB 3 SLSBs ............................................... 626
23.3. Using Spring’s EJB implementation support classes ......................................... 627
EJB 3 injection interceptor .............................................................................. 627
24. JMS (Java Message Service) .................................................................................... 628
24.1. Introduction .................................................................................................... 628
24.2. Using Spring JMS .......................................................................................... 628
JmsTemplate .................................................................................................. 628
Connections ................................................................................................... 629
Caching Messaging Resources ............................................................... 629
SingleConnectionFactory ......................................................................... 630
CachingConnectionFactory ...................................................................... 630
Destination Management ................................................................................. 630
Message Listener Containers .......................................................................... 631
SimpleMessageListenerContainer ............................................................ 631
DefaultMessageListenerContainer ............................................................ 631
剩余843页未读,继续阅读
2011-07-20 上传
2019-06-13 上传
210 浏览量
2020-07-17 上传
2011-04-15 上传
2019-05-30 上传
reharder
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Gooper1 Data Pack:新的 G1DP 存储库。 去贡献!-开源
- iOS Apprentice v7.0 (iOS12 & Swift4.2 & Xc.zip
- PersonalPage:我的NextJS个人开发人员页面
- CS300P07
- AppAuth-JS:JavaScript客户端SDK,用于与OAuth 2.0和OpenID Connect提供程序进行通信
- js和CSS3炫酷圆形导航菜单插件
- 裂纹检测:使用计算机视觉工具箱进行裂纹检测-matlab开发
- 开源软路由OPENWRT2020.9.8原版VMWARE固件
- Onboard-SDK:DJI Onboard SDK官方资料库
- projetoFinal-ips-2-ano
- chips_thermal_face_dataset:芯片热敏面数据集是一个大规模的热敏面数据集(来自3个不同大洲的1200幅男性和女性图像,年龄在18-23岁之间)。 该数据集将可供全世界的研究人员使用最新的深度学习方法创建准确的热面部分类和热面部识别系统
- pamansayurdev.github.io:网站paman sayur
- MO_Ring_PSO_SCD:它是用于多模态多目标优化的多目标 PSO-matlab开发
- resynthesizer:用于纹理合成的gimp插件套件
- NavigationDrawer:这是一个示例项目,用于演示如何制作导航抽屉。此外,在这个项目中,我添加了材料设计,因此对于想要实现材料设计、工具栏等的人也有帮助
- hacker-news-clone
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功