dbConfig.properties的配置,一些數據庫鏈接信息,只用了配置的一小部分:
java
driverClass=com.mysql.jdbc.Driver jdbcUrl=jdbc:mysql://127.0.0.1:3306/ssh user=root password= initialPoolSize=5 minPoolSize=5 maxPoolSize=10 maxStatements=10
mvc-config.xml,也配置了上傳功能:mysql
<?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:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan base-package="simples.web" use-default-filters="false"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </context:component-scan> <mvc:annotation-driven/> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass"> <value>org.springframework.web.servlet.view.JstlView</value> </property> <property name="prefix"> <value>/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="maxUploadSize" value="800000000"/> </bean> </beans>
hibernate.cfg.xml,配置了2級緩存:
web
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory name="sessionFactory"> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="show_sql">true</property> <property name="hbm2ddl.auto">update</property> <property name="cache.use_second_level_cache">true</property> <property name="cache.region.factory_class ">org.hibernate.cache.ehcache.EhCacheRegionFactory</property> </session-factory> </hibernate-configuration>
以上就是所有配置文件,下一篇將編寫簡單的幾個類,來測試基本的功能。
spring