没有合适的资源?快使用搜索试试~ 我知道了~
首页Spring框架3.0.5参考文档解析
"Spring 3.0.5帮助文档提供了关于Spring框架全面的参考信息,涵盖了核心容器、数据访问/集成、Web、AOP和乐器化、测试等多个模块,旨在帮助开发者理解和使用Spring框架的各项功能。"
Spring框架是Java开发中的一个关键组件,尤其在企业级应用开发中广泛应用。Spring 3.0.5版本的文档详细介绍了该框架的主要特性,包括:
1. **Introduction to Spring Framework**: 引入了Spring的核心概念,如依赖注入(Dependency Injection, DI)和控制反转(Inversion of Control, IoC)。依赖注入是Spring的核心特性,它允许对象之间通过配置文件或编程方式声明依赖关系,而不是硬编码在类内部。控制反转则是这一机制的理论基础,它将对象的创建和管理权交给框架,降低了代码间的耦合度。
2. **Modules**: Spring框架由多个模块组成,主要包括:
- **Core Container**: 包括Core和Beans模块,提供IoC容器和Bean的定义与管理。
- **Data Access/Integration**: 提供了对数据库访问的支持,如JDBC、ORM(Object-Relational Mapping)框架如Hibernate和MyBatis等。
- **Web**: 包括Web-Servlet、Web-MVC和Web-Portlet模块,支持构建Web应用程序,特别是基于MVC设计模式的应用。
- **AOP and Instrumentation**: AOP(Aspect-Oriented Programming)模块提供了面向切面编程的功能,用于实现如日志、事务管理等跨切面的关注点。Instrumentation则用于类加载器和代理相关的高级功能。
- **Test**: 提供了测试支持,包括JUnit和TestNG的集成,以及模拟对象和Web应用测试工具。
3. **Usage scenarios**: 文档还讨论了Spring在不同场景下的使用,如如何进行依赖管理和命名约定。这包括对Maven和Ivy两种依赖管理工具的指导,帮助开发者有效地管理项目中的依赖库。
4. **Dependency Management and Naming Conventions**: 明确了Spring框架的依赖管理规则,以及如何与其他依赖库协调。对于Maven用户,Spring 3.0.5文档包含了对应的依赖管理配置,而对于使用Ivy的用户,也有相应的指导。
5. **Logging**: Spring框架集成了多种日志系统,如Log4j、Java Util Logging和SLF4J,提供了灵活的日志解决方案。
Spring 3.0.5帮助文档是开发者理解和使用该版本Spring框架的重要参考资料,无论是在初始化项目、配置服务、还是进行单元测试,都能找到详尽的指导和示例。通过学习这些内容,开发者可以充分利用Spring的优势,构建出高效、可维护的Java应用程序。
![](https://csdnimg.cn/release/download_crawler_static/5649673/bg10.jpg)
HTML escaping and XHTML compliance .............................................482
16.5. XSLT ..........................................................................................................483
My First Words ............................................................................................483
Bean definitions ...................................................................................483
Standard MVC controller code ..............................................................483
Convert the model data to XML ............................................................484
Defining the view properties ..................................................................484
Document transformation ......................................................................485
Summary .....................................................................................................485
16.6. Document views (PDF/Excel) .......................................................................486
Introduction .................................................................................................486
Configuration and setup ................................................................................486
Document view definitions ....................................................................486
Controller code .....................................................................................486
Subclassing for Excel views ..................................................................487
Subclassing for PDF views ....................................................................488
16.7. JasperReports ...............................................................................................489
Dependencies ...............................................................................................489
Configuration ...............................................................................................489
Configuring the ViewResolver ..............................................................489
Configuring the Views ..........................................................................490
About Report Files ...............................................................................490
Using JasperReportsMultiFormatView ...................................................490
Populating the ModelAndView ......................................................................491
Working with Sub-Reports ............................................................................492
Configuring Sub-Report Files ................................................................492
Configuring Sub-Report Data Sources ...................................................493
Configuring Exporter Parameters ...................................................................493
16.8. Feed Views ..................................................................................................494
16.9. XML Marshalling View ................................................................................495
16.10. JSON Mapping View ..................................................................................495
17. Integrating with other web frameworks .....................................................................496
17.1. Introduction .................................................................................................496
17.2. Common configuration .................................................................................497
17.3. JavaServer Faces 1.1 and 1.2 .........................................................................498
DelegatingVariableResolver (JSF 1.1/1.2) ......................................................498
SpringBeanVariableResolver (JSF 1.1/1.2) .....................................................499
SpringBeanFacesELResolver (JSF 1.2+) ........................................................499
FacesContextUtils ........................................................................................500
17.4. Apache Struts 1.x and 2.x .............................................................................500
ContextLoaderPlugin ....................................................................................501
DelegatingRequestProcessor .................................................................502
DelegatingActionProxy .........................................................................502
ActionSupport Classes ..................................................................................503
17.5. WebWork 2.x ...............................................................................................503
Spring Framework
3.0 Reference Documentation xvi
![](https://csdnimg.cn/release/download_crawler_static/5649673/bg11.jpg)
17.6. Tapestry 3.x and 4.x .....................................................................................504
Injecting Spring-managed beans ....................................................................505
Dependency Injecting Spring Beans into Tapestry pages .........................506
Component definition files ....................................................................507
Adding abstract accessors ......................................................................508
Dependency Injecting Spring Beans into Tapestry pages - Tapestry 4.x style
.............................................................................................................510
17.7. Further Resources .........................................................................................511
18. Portlet MVC Framework .........................................................................................512
18.1. Introduction .................................................................................................512
Controllers - The C in MVC ..........................................................................513
Views - The V in MVC .................................................................................513
Web-scoped beans ........................................................................................514
18.2. The DispatcherPortlet ...................................................................................514
18.3. The ViewRendererServlet .............................................................................516
18.4. Controllers ...................................................................................................517
AbstractController and PortletContentGenerator .............................................517
Other simple controllers ................................................................................519
Command Controllers ...................................................................................519
PortletWrappingController ............................................................................520
18.5. Handler mappings ........................................................................................520
PortletModeHandlerMapping ........................................................................521
ParameterHandlerMapping ............................................................................522
PortletModeParameterHandlerMapping .........................................................522
Adding HandlerInterceptors ..........................................................................523
HandlerInterceptorAdapter ............................................................................523
ParameterMappingInterceptor .......................................................................523
18.6. Views and resolving them .............................................................................524
18.7. Multipart (file upload) support ......................................................................524
Using the PortletMultipartResolver ................................................................525
Handling a file upload in a form ....................................................................525
18.8. Handling exceptions .....................................................................................528
18.9. Annotation-based controller configuration .....................................................529
Setting up the dispatcher for annotation support ..............................................529
Defining a controller with @Controller ..........................................................529
Mapping requests with @RequestMapping .....................................................530
Supported handler method arguments ............................................................531
Binding request parameters to method parameters with @RequestParam ..........533
Providing a link to data from the model with @ModelAttribute .......................534
Specifying attributes to store in a Session with @SessionAttributes .................534
Customizing WebDataBinder initialization .....................................................535
Customizing data binding with @InitBinder ...........................................535
Configuring a custom WebBindingInitializer ..........................................535
18.10. Portlet application deployment ....................................................................536
VI. Integration ......................................................................................................................537
Spring Framework
3.0 Reference Documentation xvii
![](https://csdnimg.cn/release/download_crawler_static/5649673/bg12.jpg)
19. Remoting and web services using Spring ..................................................................538
19.1. Introduction .................................................................................................538
19.2. Exposing services using RMI ........................................................................539
Exporting the service using the RmiServiceExporter .......................................539
Linking in the service at the client .................................................................540
19.3. Using Hessian or Burlap to remotely call services via HTTP ...........................541
Wiring up the DispatcherServlet for Hessian and co. .......................................541
Exposing your beans by using the HessianServiceExporter ..............................541
Linking in the service on the client ................................................................542
Using Burlap ................................................................................................542
Applying HTTP basic authentication to a service exposed through Hessian or
Burlap ..........................................................................................................543
19.4. Exposing services using HTTP invokers ........................................................543
Exposing the service object ...........................................................................543
Linking in the service at the client .................................................................544
19.5. Web services ................................................................................................545
Exposing servlet-based web services using JAX-RPC .....................................546
Accessing web services using JAX-RPC ........................................................546
Registering JAX-RPC Bean Mappings ...........................................................548
Registering your own JAX-RPC Handler .......................................................549
Exposing servlet-based web services using JAX-WS ......................................549
Exporting standalone web services using JAX-WS .........................................550
Exporting web services using the JAX-WS RI's Spring support .......................551
Accessing web services using JAX-WS ..........................................................551
19.6. JMS .............................................................................................................552
Server-side configuration ..............................................................................553
Client-side configuration ...............................................................................554
19.7. Auto-detection is not implemented for remote interfaces .................................555
19.8. Considerations when choosing a technology ...................................................555
19.9. Accessing RESTful services on the Client ......................................................556
RestTemplate ...............................................................................................556
Dealing with request and response headers .............................................558
HTTP Message Conversion ...........................................................................559
StringHttpMessageConverter .................................................................559
FormHttpMessageConverter ..................................................................559
ByteArrayMessageConverter .................................................................560
MarshallingHttpMessageConverter ........................................................560
MappingJacksonHttpMessageConverter .................................................560
SourceHttpMessageConverter ...............................................................560
BufferedImageHttpMessageConverter ...................................................560
20. Enterprise JavaBeans (EJB) integration ....................................................................561
20.1. Introduction .................................................................................................561
20.2. Accessing EJBs ............................................................................................561
Concepts ......................................................................................................561
Accessing local SLSBs .................................................................................562
Spring Framework
3.0 Reference Documentation xviii
![](https://csdnimg.cn/release/download_crawler_static/5649673/bg13.jpg)
Accessing remote SLSBs ..............................................................................563
Accessing EJB 2.x SLSBs versus EJB 3 SLSBs ..............................................564
20.3. Using Spring's EJB implementation support classes ........................................564
EJB 2.x base classes .....................................................................................564
EJB 3 injection interceptor ............................................................................566
21. JMS (Java Message Service) ....................................................................................568
21.1. Introduction .................................................................................................568
21.2. Using Spring JMS ........................................................................................568
JmsTemplate ................................................................................................568
Connections .................................................................................................569
Caching Messaging Resources ...............................................................570
SingleConnectionFactory ......................................................................570
CachingConnectionFactory ...................................................................570
Destination Management ...............................................................................570
Message Listener Containers .........................................................................571
SimpleMessageListenerContainer ..........................................................572
DefaultMessageListenerContainer .........................................................572
Transaction management ...............................................................................572
21.3. Sending a Message .......................................................................................573
Using Message Converters ............................................................................574
SessionCallback and ProducerCallback ..........................................................575
21.4. Receiving a message .....................................................................................575
Synchronous Reception .................................................................................575
Asynchronous Reception - Message-Driven POJOs ........................................575
The SessionAwareMessageListener interface .................................................576
The MessageListenerAdapter ........................................................................576
Processing messages within transactions ........................................................578
21.5. Support for JCA Message Endpoints ..............................................................579
21.6. JMS Namespace Support ..............................................................................581
22. JMX .......................................................................................................................586
22.1. Introduction .................................................................................................586
22.2. Exporting your beans to JMX ........................................................................586
Creating an MBeanServer .............................................................................587
Reusing an existing MBeanServer .................................................................588
Lazy-initialized MBeans ...............................................................................589
Automatic registration of MBeans .................................................................589
Controlling the registration behavior ..............................................................589
22.3. Controlling the management interface of your beans .......................................591
The MBeanInfoAssembler Interface ..............................................................591
Using Source-Level Metadata (JDK 5.0 annotations) ......................................591
Source-Level Metadata Types .......................................................................593
The AutodetectCapableMBeanInfoAssembler interface ...................................595
Defining management interfaces using Java interfaces ....................................596
Using MethodNameBasedMBeanInfoAssembler ............................................597
22.4. Controlling the ObjectNames for your beans ..................................................597
Spring Framework
3.0 Reference Documentation xix
![](https://csdnimg.cn/release/download_crawler_static/5649673/bg14.jpg)
Reading ObjectNames from Properties ...........................................................598
Using the MetadataNamingStrategy ...............................................................599
The <context:mbean-export/> element ...........................................................599
22.5. JSR-160 Connectors .....................................................................................600
Server-side Connectors .................................................................................600
Client-side Connectors ..................................................................................601
JMX over Burlap/Hessian/SOAP ...................................................................601
22.6. Accessing MBeans via Proxies ......................................................................602
22.7. Notifications ................................................................................................602
Registering Listeners for Notifications ...........................................................602
Publishing Notifications ................................................................................606
22.8. Further Resources .........................................................................................607
23. JCA CCI .................................................................................................................608
23.1. Introduction .................................................................................................608
23.2. Configuring CCI ..........................................................................................608
Connector configuration ................................................................................608
ConnectionFactory configuration in Spring ....................................................609
Configuring CCI connections ........................................................................610
Using a single CCI connection .......................................................................610
23.3. Using Spring's CCI access support .................................................................611
Record conversion ........................................................................................611
The CciTemplate ..........................................................................................612
DAO support ................................................................................................613
Automatic output record generation ...............................................................614
Summary .....................................................................................................614
Using a CCI Connection and Interaction directly ............................................615
Example for CciTemplate usage ....................................................................616
23.4. Modeling CCI access as operation objects ......................................................618
MappingRecordOperation .............................................................................618
MappingCommAreaOperation .......................................................................619
Automatic output record generation ...............................................................619
Summary .....................................................................................................619
Example for MappingRecordOperation usage .................................................620
Example for MappingCommAreaOperation usage ..........................................622
23.5. Transactions .................................................................................................623
24. Email .....................................................................................................................625
24.1. Introduction .................................................................................................625
24.2. Usage ..........................................................................................................625
Basic MailSender and SimpleMailMessage usage ...........................................626
Using the JavaMailSender and the MimeMessagePreparator ...........................627
24.3. Using the JavaMail MimeMessageHelper ......................................................628
Sending attachments and inline resources .......................................................628
Attachments .........................................................................................628
Inline resources ....................................................................................628
Creating email content using a templating library ...........................................629
Spring Framework
3.0 Reference Documentation xx
剩余790页未读,继续阅读
110 浏览量
290 浏览量
2017-07-03 上传
点击了解资源详情
点击了解资源详情
2011-02-25 上传
![](https://profile-avatar.csdnimg.cn/2c97a57f9c4143658ca6c15e7537c6c5_moses3017.jpg!1)
moses3017
- 粉丝: 0
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 网络恶意代码安全手册:防护与分析
- 深入理解DAO架构:以iBATIS为例
- C#入门指南:从基础到面向对象
- MATLAB图形化编程指南
- Windows摄像头控制SDK源代码示例
- C#新版设计模式手册:单例、工厂等23种模式解析
- XML Schema (XSD) 讲义:定义与验证机制
- 软件工程实践与人生哲学:一本独特的启示录
- C/C++编程高质量指南:实践与规范详解
- GPSR:无线网络的边界贪婪无状态路由协议
- 学生成绩管理系统设计与实现:基于数据库和Delphi的应用
- 30分钟快速入门:正则表达式实战教程
- C#初学者指南:从基础到面向对象
- 1亿条记录:海量数据高效转移策略探讨
- ASP.NET & XML深度编程实战
- 创建型设计模式:封装与对象实例化
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)