- 1
- 0
- 约6.89千字
- 约 6页
- 2017-06-12 发布于北京
- 举报
PAGE \* MERGEFORMAT 6
SSH2项目涉及到的配置文件主要有6个,分别为:
web.xml
applicationContext.xml
struts.xml
hibernate.cfg.xml
News.hbm.xml
perties
1、web.xml
web.xml文件主要是引入了spring的监听器和Struts2的拦截器。
?xml version=1.0 encoding=UTF-8?
web-app version=2.5
xmlns=/xml/ns/javaee
xmlns:xsi=/2001/XMLSchema-instance
xsi:schemaLocation=/xml/ns/javaee
/xml/ns/javaee/web-app_2_5.xsd
context-param
param-namecontextConfigLocation/param-name
param-value/WEB-INF/classes/applicationContext.xml/param-value
/context-param
listener
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener
welcome-file-list
welcome-fileindex-news.action/welcome-file
/welcome-file-list
filter
filter-namestruts2/filter-name
filter-class
org.apache.struts2.dispatcher.FilterDispatcher
/filter-class
/filter
filter-mapping
filter-namestruts2/filter-name
url-pattern*.action/url-pattern
/filter-mapping
/web-app
2、applicationContext.xml
主要负责配置数据源、并且将hibernate的工厂纳入。
?xml version=1.0 encoding=UTF-8?
beans
xmlns=/schema/beans
xmlns:xsi=/2001/XMLSchema-instance
xmlns:p=/schema/p
xsi:schemaLocation=/schema/beans /schema/beans/spring-beans-3.0.xsd
bean id=dataSource
class=org.springframework.jdbc.datasource.DriverManagerDataSource
property name=driverClassName
valuecom.mysql.jdbc.Driver/value
/property
property name=url
valuejdbc:mysql://:3306/earth2012/value
/property
property name=username
valueroot/value
/property
property name=password
valueroot/value
/property
/bean
bean id=sessionFactory
class=org.springframework.orm.hibernate3.LocalSessionFactoryBean
property name=dataSource ref=dataSource/property
property name=hibernateProperties
value
hibernate.hbm2ddl.auto=update
hibernate.show_sql=true
hi
您可能关注的文档
- Qt入门教程--第01章QtCreator的安装和最简单程序的编写.doc
- RAC与双机热备的区别.docx
- RationalRose【UML建模】教程使用详解.doc
- RedHatAS3.0下高可用性集群配置.doc
- request在页面获取浏览器端地址含参数详解.doc
- RFID开发工具包必备知识.doc
- rhino大众甲壳虫教程.doc
- ROM基础知识名词解释.doc
- RS232(DB9)引脚定义.doc
- R在企业中的应用以及大数据.docx
- 全过程工程管理造价咨询工程监理项目服务方案投标方案(技术部分).doc
- 招标代理服务投标技术服务方案(技术方案).doc
- AI大模型与AIGC技术在公安领域的应用解决方案(99页 PPT).pptx
- 工业4.0智能制造数字工厂规划方案.pptx
- 树立社会主义核心价值观.docx
- 三年(2023-2025)中考历史真题分类汇编(全国)专题21 科技文化与社会生活(解析版).docx
- 2025年中考道德与法治真题完全解读(吉林卷).pdf
- 2025年中考道德与法治真题完全解读(安徽卷).pdf
- 三年(2023-2025)中考历史真题分类汇编(全国)专题14 人民解放战争(解析版).pdf
- 三年(2023-2025)广东中考历史真题分类汇编:专题03 中国近代史(八年级上册)(解析版).docx
原创力文档

文档评论(0)