码迷,mamicode.com
首页 > 编程语言 > 详细

maven工程web层的spring配置文档

时间:2017-06-27 01:08:53      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:ice   can   expr   factor   one   upload   base   org   max   

1、引入jdbc配置文档

2、扫描文件

3、上传文件的设置

 

下面是例子:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:p="http://www.springframework.org/schema/p"  
    xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-4.1.xsd">

    <!-- 引入jdbc配置文件 -->
    <context:property-placeholder location="classpath:properties/jdbc.properties" />

    <!-- 扫描文件 -->
    <context:component-scan base-package="com.mmc.d4alc">
        <context:exclude-filter type="annotation"
            expression="org.springframework.stereotype.Controller" />
        <context:exclude-filter type="annotation"
            expression="org.springframework.web.bind.annotation.RestController" />
        <context:exclude-filter type="annotation"
            expression="org.springframework.web.bind.annotation.ControllerAdvice" />
    </context:component-scan>

    <!-- 上传文件的设置 ,maxUploadSize=-1,表示无穷大。uploadTempDir为上传的临时目录 -->  
   <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"    
        p:defaultEncoding="UTF-8"    
        p:maxUploadSize="-1"    
        p:uploadTempDir="file"    
     /> 

    

    
    <bean id="info"
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="locations">
            <array>
                <value>classpath:properties/info.properties</value>
                <value>classpath:properties/fileupload.properties</value>
            </array>
        </property>
    </bean>
    

</beans>

 

maven工程web层的spring配置文档

标签:ice   can   expr   factor   one   upload   base   org   max   

原文地址:http://www.cnblogs.com/suiyisuixing/p/7082993.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!