没有合适的资源?快使用搜索试试~ 我知道了~
首页深入理解Spring框架教程:从入门到高级
"Spring教程"是针对Java开发人员的一份全面指南,由罗德·约翰逊(Rod Johnson)创建并首次发布于2003年6月,采用Apache2.0许可证。本教程基于Spring Framework 4.1.6版本,这个框架旨在提供强大且高效的Java应用程序开发基础设施,简化开发过程,加快项目速度。 该教程的目标受众是对Spring框架有深入理解需求的Java程序员,特别适合那些希望掌握Spring架构以及其实际应用的中级开发者。通过学习,读者可以提升到高级技术专家的水平。在开始之前,读者需要具备良好的Java编程基础,同时对Eclipse IDE有所了解,因为所有示例都将在Eclipse环境中编译。 教程内容详尽,覆盖了Spring框架的核心概念,包括依赖注入(Dependency Injection)、面向切面编程(Aspect Oriented Programming)、AOP、事务管理、Spring MVC和Spring Boot等各个方面。此外,教程还包含了实践性的问题与解答环节,专门为帮助学习者解决在理解和应用Spring过程中可能遇到的问题提供了针对性的支持。 通过跟随Spring教程,读者将学会如何构建可扩展、模块化和高效率的Java应用程序,从而提升软件开发能力,并为在实际项目中高效利用Spring框架奠定坚实的基础。无论是初学者还是有一定经验的开发者,都能从中获益匪浅,进一步提升自己的职业竞争力。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/9744413/bgd.jpg)
http://www.tutorialspoint.com/spring/spring_ioc_containers.htm
Copyright © tutorialspoint.com
SPRING - IOC CONTAINERS
SPRING - IOC CONTAINERS
The Spring container is at the core of the Spring Framework. The container will create the objects,
wire them together, configure them, and manage their complete lifecycle from creation till
destruction. The Spring container uses dependency injection DI to manage the components that
make up an application. These objects are called Spring Beans which we will discuss in next
chapter.
The container gets its instructions on what objects to instantiate, configure, and assemble by
reading configuration metadata provided. The configuration metadata can be represented either
by XML, Java annotations, or Java code. The following diagram is a high-level view of how Spring
works. The Spring IoC container makes use of Java POJO classes and configuration metadata to
produce a fully configured and executable system or application.
Spring provides following two distinct types of containers.
S.N. Container & Description
1 Spring BeanFactory Container
This is the simplest container providing basic support for DI and defined by the
org.springframework.beans.factory.BeanFactory interface. The BeanFactory and related
interfaces, such as BeanFactoryAware, InitializingBean, DisposableBean, are still present
in Spring for the purposes of backward compatibility with the large number of third-party
frameworks that integrate with Spring.
2 Spring ApplicationContext Container
This container adds more enterprise-specific functionality such as the ability to resolve
textual messages from a properties file and the ability to publish application events to
interested event listeners. This container is defined by the
org.springframework.context.ApplicationContext interface.
The ApplicationContext container includes all functionality of the BeanFactory container, so it is
generally recommended over the BeanFactory. BeanFactory can still be used for light weight
![](https://csdnimg.cn/release/download_crawler_static/9744413/bge.jpg)
applications like mobile devices or applet based applications where data volume and speed is
significant.
Loading [MathJax]/jax/output/HTML-CSS/jax.js
![](https://csdnimg.cn/release/download_crawler_static/9744413/bgf.jpg)
http://www.tutorialspoint.com/spring/spring_beanfactory_container.htm
Copyright © tutorialspoint.com
SPRING BEANFACTORY CONTAINER
SPRING BEANFACTORY CONTAINER
This is the simplest container providing basic support for DI and defined by the
org.springframework.beans.factory.BeanFactory interface. The BeanFactory and related
interfaces, such as BeanFactoryAware, InitializingBean, DisposableBean, are still present in Spring
for the purposes of backward compatibility with the large number of third-party frameworks that
integrate with Spring.
There are a number of implementations of the BeanFactory interface that come supplied straight
out-of-the-box with Spring. The most commonly used BeanFactory implementation is the
XmlBeanFactory class. This container reads the configuration metadata from an XML file and
uses it to create a fully configured system or application.
The BeanFactory is usually preferred where the resources are limited like mobile devices or applet
based applications. So use an ApplicationContext unless you have a good reason for not doing so.
Example:
Let us have working Eclipse IDE in place and follow the following steps to create a Spring
application:
Step Description
1 Create a project with a name SpringExample and create a package com.tutorialspoint
under the src folder in the created project.
2 Add required Spring libraries using Add External JARs option as explained in the Spring
Hello World Example chapter.
3 Create Java classes HelloWorld and MainApp under the com.tutorialspoint package.
4 Create Beans configuration file Beans.xml under the src folder.
5 The final step is to create the content of all the Java files and Bean Configuration file and
run the application as explained below.
Here is the content of HelloWorld.java file:
package com.tutorialspoint;
public class HelloWorld {
private String m essage;
public void setMessage(String message){
this.message = message;
}
public void getMessage(){
System .out.println("Your Message : " + message);
}
}
Following is the content of the second file MainApp.java:
package com.tutorialspoint;
im port org.springframework.beans.factory.InitializingBean;
im port org.springframework.beans.factory.xml.XmlBeanFactory;
im port org.springframework.core.io.ClassPathResource;
public class MainApp {
剩余73页未读,继续阅读
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://profile-avatar.csdnimg.cn/a6aa286eeab74b22b24a03b2eadefa29_yhcharles.jpg!1)
yhcharles
- 粉丝: 10
- 资源: 9
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 多模态联合稀疏表示在视频目标跟踪中的应用
- Kubernetes资源管控与Gardener开源软件实践解析
- MPI集群监控与负载平衡策略
- 自动化PHP安全漏洞检测:静态代码分析与数据流方法
- 青苔数据CEO程永:技术生态与阿里云开放创新
- 制造业转型: HyperX引领企业上云策略
- 赵维五分享:航空工业电子采购上云实战与运维策略
- 单片机控制的LED点阵显示屏设计及其实现
- 驻云科技李俊涛:AI驱动的云上服务新趋势与挑战
- 6LoWPAN物联网边界路由器:设计与实现
- 猩便利工程师仲小玉:Terraform云资源管理最佳实践与团队协作
- 类差分度改进的互信息特征选择提升文本分类性能
- VERITAS与阿里云合作的混合云转型与数据保护方案
- 云制造中的生产线仿真模型设计与虚拟化研究
- 汪洋在PostgresChina2018分享:高可用 PostgreSQL 工具与架构设计
- 2018 PostgresChina大会:阿里云时空引擎Ganos在PostgreSQL中的创新应用与多模型存储
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)