You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
2.2 KiB
46 lines
2.2 KiB
<?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"
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
|
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
|
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
|
|
<context:component-scan base-package="com" />
|
|
<mvc:annotation-driven></mvc:annotation-driven>
|
|
<mvc:default-servlet-handler />
|
|
|
|
<bean id="multipartResolver"
|
|
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
|
<!-- maxUploadSize:文件上传的最大值以byte为单位 -->
|
|
<property name="maxUploadSize" value="1024000"></property>
|
|
</bean>
|
|
|
|
<!-- 视图解析器 -->
|
|
<bean
|
|
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
|
<property name="prefix" value="/"></property>
|
|
<property name="suffix" value=".jsp"></property>
|
|
</bean>
|
|
<!-- 加载处部属性文件 -->
|
|
<context:property-placeholder location="classpath:db.properties" />
|
|
<!-- 数据源 -->
|
|
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
|
|
<property name="driverClassName" value="${driverName}" />
|
|
<property name="url" value="${url}" />
|
|
<property name="username" value="${user_name}" />
|
|
<property name="password" value="${user_pwd}" />
|
|
</bean>
|
|
|
|
<!-- 配置sqlSessionFactoryBean -->
|
|
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
|
<property name="dataSource" ref="dataSource" />
|
|
<property name="configLocation" value="classpath:config.xml" />
|
|
</bean>
|
|
|
|
<!-- 配置MappeScannerConfigure -->
|
|
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
|
<property name="basePackage" value="com.dao" />
|
|
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
|
|
</bean>
|
|
</beans> |