您的位置:首页 > 编程语言 > Java开发

Spring 框架的搭建及测试

2017-01-11 01:07 274 查看
1、项目结构如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> 
<bean id="stu" class="com.sxl.pojos.Student" scope="prototype"></bean>

<bean id="dao" class="com.sxl.dao.StudentDao"></bean>

<bean id="service" class="com.sxl.service.StudentService">
<property name="mydao" ref="dao"></property>
</bean>
</beans>


View Code
7、测试结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: