码迷,mamicode.com
首页 > 编程语言 > 详细

struts2,hibernate,spring整合笔记(3)

时间:2015-05-22 00:28:23      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

struts2,hibernate,spring整合笔记(1)

struts2,hibernate,spring整合笔记(2)

配好struts和hibernate就要开始spring了

老规矩,还是先导入jar包

spring.jar

aspectjrt.jar

aspectjwerver.jar

cglib-nodep-2.1_3.jar

common-logging.jar

c3p0-0.9.1.jar

之后加入配置文件src目录下applicationContext.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" 
               xmlns:context="http://www.springframework.org/schema/context"
               xmlns:tx="http://www.springframework.org/schema/tx"
               xsi:schemaLocation="http://www.springframework.org/schema/beans 
                                 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                                   http://www.springframework.org/schema/context 
                                     http://www.springframework.org/schema/context/spring-context-2.5.xsd
                                     http://www.springframework.org/schema/tx 
                                     http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">


    <context:component-scan base-package="com.spring"></context:component-scan>

</beans>

spring采用的注解的方式,设置好包就行了

 

至此,三大框架已经都导入成功了,接下类就是整合了

struts2,hibernate,spring整合笔记(3)

标签:

原文地址:http://www.cnblogs.com/asens/p/4521193.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!