1
springMvc
/
完成web.xml的配置后,在前面建好的resources文件夹下新建application.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-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:component-scan base-package=“com.cya”/>
<bean id=“propertyConfigurer”
class=“org.springframework.beans.factory.config.PropertyPlaceholderConfigurer”>
classpath*:dbconfig.properties
<bean id=“dataSource” class=“com.alibaba.druid.pool.DruidDataSource”
destroy-method=“close”>
<bean id=“sqlSessionFactory”
class=“org.springframework.orm.hibernate3.LocalSessionFactoryBean”>
${hibernate.dialect}
${hibernate.show_sql}
${hibernate.format_sql}
${hibernate.hbm2ddl.auto}