SSH2项目配置文件示例.docxVIP

  • 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

文档评论(0)

1亿VIP精品文档

相关文档