<?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">
<!-- 扫描配置 -->
<context:component-scan base-package="cn.cd"></context:component-scan>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
</beans>
改成
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 扫描配置 -->
<context:component-scan base-package="cn.cd"></context:component-scan>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
</beans>
改后就可以正常运行了,只是多了几个声明,暂时不知道为什么……
- 大小: 22.4 KB
分享到:
相关推荐
applicationContext.xml 详细配置
struts.xml和applicationContext.xml、web.xml的配置
Spring applicationContext.xml常见部分属性的使用备注
SSH框架applicationContext.xml头部文件
这是一些配置文件,可以作为参考,个人感觉很方便的学习方法
applicationContext.xml详解
包含applicationContext.xml、db.properties、log4j.properties、spring-mvc.xml文件,方便搭建,省去写代码。。
Spring Boot技术知识点:如何读取不同路径里的applicationContext.xml配置文件4
详解Spring的applicationContext.xml文件代码:
applicationContext.xml完美配置
ssh框架事务管理applicationContext.xml配置文件
spring4的“所有jar包”+applicationContext.xml+web.xml====全套
在SSH的applicationContext.xml 中如何配制配制事务
本篇文章主要介绍了详解spring applicationContext.xml 配置文件 ,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
spring+jpa的applicationContext.xml配置
applicationContext.xml+hiberniate属性+Session属性+自动代理+拦截器!!!! 上传的限制去除了jar包!