- 5
- 0
- 约1.28万字
- 约 13页
- 2019-02-01 发布于四川
- 举报
spring4.x + hibernate4.x 配置详解
关于spring和hibernate的使用以及特征等等,在此不再啰嗦,相信大家也都知道,或者去搜索一下即可。
本篇博文的内容主要是我最近整理的关于spring4.x 和 hibernate 4.x 相关配置和使用方式,当然spring3.x以及hibernate4.x也可以借鉴。
?
首先是配置文件 web.xml 增加以下代码即可
!-- 加载spring相关的配置文件 --
context-param
param-namecontextConfigLocation/param-name
param-valueclasspath*:/applicationContext.xml/param-value
/context-param
!-- 启用spring监听 --
listener
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener
?
然后建立?applicationContext.xml 文件 ,src下。 文件内容如下,注释我尽量写的很详细
beans xmlns:xsi=/
原创力文档

文档评论(0)