spring框架如何配置
来源:互联网 发布:java防止接口重复提交 编辑:程序博客网 时间:2024/06/05 04:22
1.首先从springframework的官网上下载所需要的jar包
官网:http://spring.io/
2.spring所需要的jar包
Spring-core-3.2.x.RELEASE.jar
spring框架核心jar包
Spring-beans-3.2.x.RELEASE.jar
spring框架管理Bean工厂的jar包
Spring-context-3.2.x.RELEASE.jar
spring框架上下文环境依赖的jar包
Spring-expression-3.2.x.RELEASE.jar
Spring表达式语言依赖的jar包
Commons-logging-1.x.x.jar
spring依赖的第三方的jar包
3.开始配置在eclipse中建立一个java project,引入以上所需要的jar包,选中所建的工程右击鼠标选择BuildPath -> Add Libraries ->User Libraries里面选择所存jar包的名称后点击
finish完成对jar薄的引入
4.在xml文件中的配置
java工程:
xml中的配置:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- 使用这种调用方法是调用当前class所指向类中方法 -->
<bean id="dao" class="com.phome.dao.DAO">
<property name="name" value="mysql"></property>
</bean>
<bean id="service" class="com.phome.service.Service">
<property name="dao" ref="dao"></property>
</bean>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- 使用这种调用方法是调用当前class所指向类中方法 -->
<bean id="dao" class="com.phome.dao.DAO">
<property name="name" value="mysql"></property>
</bean>
<bean id="service" class="com.phome.service.Service">
<property name="dao" ref="dao"></property>
</bean>
</beans>
以上就是大体的spring框架配置
0 0
- spring框架如何配置
- Spring框架中的定时器 如何使用和配置
- Spring框架中的定时器 如何使用和配置
- Spring框架中的定时器quartzquartz如何使用和配置
- Spring框架中的定时器 如何使用和配置
- Spring框架中的定时器 如何使用和配置
- Spring框架的配置
- Spring框架的配置
- spring 框架配置类
- 如何配置hibernate框架
- 如何配置springdata框架
- 如何配置spring+struts?
- 新手如何配置spring
- spring-mybatis如何配置
- Spring.net + Nhibernate 框架 配置
- SSH框架Spring注入配置
- Spring框架中配置数据库
- Shiro配置---基于spring框架
- Ubuntu上类似:bash: /usr/lib/ant/apache-ant-1.8.2/bin/ant: Permission denied 问题的解决方法
- chm文件无法搜索或者MSDN搜索失效解决方法
- javax.naming.NameNotFoundException: myqueue not bound
- 基于小波变换的数字水印技术研究
- android 性能分析工具
- spring框架如何配置
- vim编辑器命令行使用总结
- hdu4560 不错的建图,二分最大流
- 使用 jQuery dataTables - 2 四种数据来源
- PB vs XML vs JSON
- 第6周作业1-闰年之循环判断
- 第七周工作报告(2014.4.6~4.13)
- 在线打字测速系统
- WTL: CTabView 源码分析