没有合适的资源?快使用搜索试试~ 我知道了~
首页Spring 3.1官方文档详解:依赖注入与模块化架构
Spring 3.1官方文档是Spring框架的权威指南,由多位知名开发者共同编撰,包括Rod Johnson、Juergen Hoeller等人。这份文档提供了全面的参考信息,涵盖了Spring框架的核心概念、模块功能以及使用场景。
1. **概述** (Overview of Spring Framework)
- Spring Framework 是一个全面的企业级应用开发框架,它以依赖注入(Dependency Injection, DI)和控制反转(Inversion of Control, IoC)为核心理念,简化了应用程序的架构和管理。
2. **模块介绍**
- **Core Container**: 提供了轻量级的IoC容器,用于管理对象的生命周期和依赖关系。
- **Data Access/Integration**: 包括数据访问抽象层(如JDBC、ORM等),支持与多种数据库和数据源的集成。
- **Web** 部分涵盖了Spring MVC、Spring WebFlux等web开发工具,方便构建高效、可扩展的web应用。
- **AOP(Aspect Oriented Programming)和Instrumentation**: 提供了面向切面编程的支持,以及对性能监控和代码增强的工具。
- **Test** 模块专注于测试驱动开发,提供单元测试和集成测试的相关工具。
3. **使用场景与实践**
- 文档详细介绍了如何在实际项目中运用Spring框架,比如配置服务层、数据访问层、前端控制器等。
4. **依赖管理和命名约定**
- 强调了依赖管理的重要性,包括Spring框架自身的依赖以及项目中其他模块之间的依赖关系。
- 提供了Maven和Ivy两种流行的构建工具的集成,确保项目的模块化和版本管理。
5. **日志处理**
- Spring 3.1版本关注日志管理,可能包含对Spring Logging或第三方日志框架的整合说明。
作为一份免费资源,Spring 3.1官方文档鼓励用户复制和分发文档,但必须保持原版权声明完整,不得收取费用,并确保每一份副本都包含版权通知,无论是纸质还是电子形式。这份文档对于学习和理解Spring 3.1的开发者来说是一份宝贵的参考资料,它覆盖了从入门到深入使用的各个方面,是提升开发技能和效率的重要工具。
HandlerExceptionResolver ............................................................................484
@ExceptionHandler ......................................................................................485
16.12. Convention over configuration support ........................................................486
The Controller ControllerClassNameHandlerMapping ....................................486
The Model ModelMap (ModelAndView) .......................................................487
The View - RequestToViewNameTranslator ..................................................488
16.13. ETag support ..............................................................................................490
16.14. Configuring Spring MVC ............................................................................490
Enabling MVC Java Config or the MVC XML Namespace .............................491
Customizing the Provided Configuration ........................................................492
Configuring Interceptors ...............................................................................493
Configuring View Controllers .......................................................................494
Configuring Serving of Resources .................................................................494
mvc:default-servlet-handler ...........................................................................496
More Spring Web MVC Resources ................................................................497
Advanced Customizations with MVC Java Config ..........................................498
Advanced Customizations with the MVC Namespace .....................................498
17. View technologies ...................................................................................................500
17.1. Introduction .................................................................................................500
17.2. JSP & JSTL .................................................................................................500
View resolvers .............................................................................................500
'Plain-old' JSPs versus JSTL ..........................................................................501
Additional tags facilitating development ........................................................501
Using Spring's form tag library ......................................................................501
Configuration .......................................................................................501
The form tag ........................................................................................502
The input tag ........................................................................................503
The checkbox tag ..................................................................................503
The checkboxes tag ..............................................................................505
The radiobutton tag ...............................................................................505
The radiobuttons tag .............................................................................506
The password tag ..................................................................................506
The select tag .......................................................................................506
The option tag ......................................................................................507
The options tag .....................................................................................507
The textarea tag ....................................................................................508
The hidden tag ......................................................................................508
The errors tag .......................................................................................509
HTTP Method Conversion ....................................................................511
HTML5 Tags .......................................................................................511
17.3. Tiles ............................................................................................................512
Dependencies ...............................................................................................512
How to integrate Tiles ...................................................................................512
UrlBasedViewResolver .........................................................................513
ResourceBundleViewResolver ..............................................................513
Spring Framework
3.1 Reference Documentation xvi
SimpleSpringPreparerFactory and SpringBeanPreparerFactory ................513
17.4. Velocity & FreeMarker .................................................................................514
Dependencies ...............................................................................................514
Context configuration ...................................................................................514
Creating templates ........................................................................................515
Advanced configuration ................................................................................515
velocity.properties ................................................................................515
FreeMarker ..........................................................................................516
Bind support and form handling .....................................................................516
The bind macros ...................................................................................517
Simple binding .....................................................................................517
Form input generation macros ...............................................................518
HTML escaping and XHTML compliance .............................................522
17.5. XSLT ..........................................................................................................523
My First Words ............................................................................................523
Bean definitions ...................................................................................523
Standard MVC controller code ..............................................................523
Convert the model data to XML ............................................................524
Defining the view properties ..................................................................525
Document transformation ......................................................................525
Summary .....................................................................................................525
17.6. Document views (PDF/Excel) .......................................................................526
Introduction .................................................................................................526
Configuration and setup ................................................................................526
Document view definitions ....................................................................526
Controller code .....................................................................................527
Subclassing for Excel views ..................................................................527
Subclassing for PDF views ....................................................................528
17.7. JasperReports ...............................................................................................529
Dependencies ...............................................................................................529
Configuration ...............................................................................................529
Configuring the ViewResolver ..............................................................529
Configuring the Views ..........................................................................530
About Report Files ...............................................................................530
Using JasperReportsMultiFormatView ...................................................531
Populating the ModelAndView ......................................................................532
Working with Sub-Reports ............................................................................532
Configuring Sub-Report Files ................................................................533
Configuring Sub-Report Data Sources ...................................................533
Configuring Exporter Parameters ...................................................................534
17.8. Feed Views ..................................................................................................534
17.9. XML Marshalling View ................................................................................535
17.10. JSON Mapping View ..................................................................................535
18. Integrating with other web frameworks .....................................................................536
18.1. Introduction .................................................................................................536
Spring Framework
3.1 Reference Documentation xvii
18.2. Common configuration .................................................................................537
18.3. JavaServer Faces 1.1 and 1.2 .........................................................................538
DelegatingVariableResolver (JSF 1.1/1.2) ......................................................538
SpringBeanVariableResolver (JSF 1.1/1.2) .....................................................539
SpringBeanFacesELResolver (JSF 1.2+) ........................................................539
FacesContextUtils ........................................................................................540
18.4. Apache Struts 1.x and 2.x .............................................................................540
ContextLoaderPlugin ....................................................................................541
DelegatingRequestProcessor .................................................................542
DelegatingActionProxy .........................................................................542
ActionSupport Classes ..................................................................................543
18.5. WebWork 2.x ...............................................................................................543
18.6. Tapestry 3.x and 4.x .....................................................................................544
Injecting Spring-managed beans ....................................................................545
Dependency Injecting Spring Beans into Tapestry pages .........................546
Component definition files ....................................................................547
Adding abstract accessors ......................................................................548
Dependency Injecting Spring Beans into Tapestry pages - Tapestry 4.x style
.............................................................................................................550
18.7. Further Resources .........................................................................................551
19. Portlet MVC Framework .........................................................................................552
19.1. Introduction .................................................................................................552
Controllers - The C in MVC ..........................................................................553
Views - The V in MVC .................................................................................553
Web-scoped beans ........................................................................................554
19.2. The DispatcherPortlet ...................................................................................554
19.3. The ViewRendererServlet .............................................................................556
19.4. Controllers ...................................................................................................557
AbstractController and PortletContentGenerator .............................................557
Other simple controllers ................................................................................559
Command Controllers ...................................................................................559
PortletWrappingController ............................................................................560
19.5. Handler mappings ........................................................................................560
PortletModeHandlerMapping ........................................................................561
ParameterHandlerMapping ............................................................................562
PortletModeParameterHandlerMapping .........................................................562
Adding HandlerInterceptors ..........................................................................563
HandlerInterceptorAdapter ............................................................................563
ParameterMappingInterceptor .......................................................................563
19.6. Views and resolving them .............................................................................564
19.7. Multipart (file upload) support ......................................................................564
Using the PortletMultipartResolver ................................................................565
Handling a file upload in a form ....................................................................565
19.8. Handling exceptions .....................................................................................568
19.9. Annotation-based controller configuration .....................................................569
Spring Framework
3.1 Reference Documentation xviii
Setting up the dispatcher for annotation support ..............................................569
Defining a controller with @Controller ..........................................................569
Mapping requests with @RequestMapping .....................................................570
Supported handler method arguments ............................................................571
Binding request parameters to method parameters with @RequestParam ..........573
Providing a link to data from the model with @ModelAttribute .......................574
Specifying attributes to store in a Session with @SessionAttributes .................574
Customizing WebDataBinder initialization .....................................................575
Customizing data binding with @InitBinder ...........................................575
Configuring a custom WebBindingInitializer ..........................................575
19.10. Portlet application deployment ....................................................................576
VI. Integration ......................................................................................................................577
20. Remoting and web services using Spring ..................................................................578
20.1. Introduction .................................................................................................578
20.2. Exposing services using RMI ........................................................................579
Exporting the service using the RmiServiceExporter .......................................579
Linking in the service at the client .................................................................580
20.3. Using Hessian or Burlap to remotely call services via HTTP ...........................581
Wiring up the DispatcherServlet for Hessian and co. .......................................581
Exposing your beans by using the HessianServiceExporter ..............................581
Linking in the service on the client ................................................................582
Using Burlap ................................................................................................582
Applying HTTP basic authentication to a service exposed through Hessian or
Burlap ..........................................................................................................583
20.4. Exposing services using HTTP invokers ........................................................583
Exposing the service object ...........................................................................583
Linking in the service at the client .................................................................584
20.5. Web services ................................................................................................585
Exposing servlet-based web services using JAX-RPC .....................................586
Accessing web services using JAX-RPC ........................................................586
Registering JAX-RPC Bean Mappings ...........................................................588
Registering your own JAX-RPC Handler .......................................................589
Exposing servlet-based web services using JAX-WS ......................................589
Exporting standalone web services using JAX-WS .........................................590
Exporting web services using the JAX-WS RI's Spring support .......................591
Accessing web services using JAX-WS ..........................................................591
20.6. JMS .............................................................................................................592
Server-side configuration ..............................................................................593
Client-side configuration ...............................................................................594
20.7. Auto-detection is not implemented for remote interfaces .................................595
20.8. Considerations when choosing a technology ...................................................595
20.9. Accessing RESTful services on the Client ......................................................596
RestTemplate ...............................................................................................596
Working with the URI ..........................................................................598
Dealing with request and response headers .............................................599
Spring Framework
3.1 Reference Documentation xix
HTTP Message Conversion ...........................................................................599
StringHttpMessageConverter .................................................................600
FormHttpMessageConverter ..................................................................600
ByteArrayMessageConverter .................................................................600
MarshallingHttpMessageConverter ........................................................600
MappingJacksonHttpMessageConverter .................................................601
SourceHttpMessageConverter ...............................................................601
BufferedImageHttpMessageConverter ...................................................601
21. Enterprise JavaBeans (EJB) integration ....................................................................602
21.1. Introduction .................................................................................................602
21.2. Accessing EJBs ............................................................................................602
Concepts ......................................................................................................602
Accessing local SLSBs .................................................................................603
Accessing remote SLSBs ..............................................................................604
Accessing EJB 2.x SLSBs versus EJB 3 SLSBs ..............................................605
21.3. Using Spring's EJB implementation support classes ........................................605
EJB 2.x base classes .....................................................................................605
EJB 3 injection interceptor ............................................................................607
22. JMS (Java Message Service) ....................................................................................609
22.1. Introduction .................................................................................................609
22.2. Using Spring JMS ........................................................................................609
JmsTemplate ................................................................................................609
Connections .................................................................................................610
Caching Messaging Resources ...............................................................611
SingleConnectionFactory ......................................................................611
CachingConnectionFactory ...................................................................611
Destination Management ...............................................................................611
Message Listener Containers .........................................................................612
SimpleMessageListenerContainer ..........................................................613
DefaultMessageListenerContainer .........................................................613
Transaction management ...............................................................................613
22.3. Sending a Message .......................................................................................614
Using Message Converters ............................................................................615
SessionCallback and ProducerCallback ..........................................................616
22.4. Receiving a message .....................................................................................616
Synchronous Reception .................................................................................616
Asynchronous Reception - Message-Driven POJOs ........................................616
The SessionAwareMessageListener interface .................................................617
The MessageListenerAdapter ........................................................................617
Processing messages within transactions ........................................................619
22.5. Support for JCA Message Endpoints ..............................................................620
22.6. JMS Namespace Support ..............................................................................622
23. JMX .......................................................................................................................627
23.1. Introduction .................................................................................................627
23.2. Exporting your beans to JMX ........................................................................627
Spring Framework
3.1 Reference Documentation xx
剩余845页未读,继续阅读
683 浏览量
2013-05-15 上传
293 浏览量
2013-01-31 上传
200 浏览量
2014-07-01 上传
zy428
- 粉丝: 0
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Datoota-crx插件
- costaricaexpress:码头快递
- eos-contracts-ts:使用Typescript + AssemblyScript编写EOS合约的一些实验
- 轮胎翻新项目商业计划书模板.zip
- XX养殖公司肉牛饲养与深加工项目商业计划书
- 虚拟宠物3:项目C36
- 实现Path应用的按钮效果
- getpoint:获取图形中点坐标的简单小部件。-matlab开发
- project-builder:构建系统
- W600功率计固件源码+上位机源码.zip
- awesome-amazon-seller:精选的亚马逊卖家工具和资源清单
- CPLUS
- 买买乐网上开店
- DrTraxx.github.io
- 获取网络数据到本地并查看
- adcarray:MATLAB 类允许将大数据集映射到从磁盘(包括从 MAT 文件)映射的内存-matlab开发
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功