<?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:mvc="http://www.springframework.org/schema/mvc"
|
xmlns:websocket="http://www.springframework.org/schema/websocket"
|
xsi:schemaLocation="
|
http://www.springframework.org/schema/beans
|
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
http://www.springframework.org/schema/context
|
http://www.springframework.org/schema/context/spring-context-4.0.xsd
|
http://www.springframework.org/schema/mvc
|
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
|
<!-- <bean id="allBean" class="com.slcf.bean.AllBean" /> -->
|
<!-- 添加注解驱动 -->
|
<!-- <mvc:annotation-driven /> -->
|
<mvc:annotation-driven>
|
<mvc:message-converters>
|
<bean
|
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
|
<property name="supportedMediaTypes">
|
<list>
|
<value>text/html;charset=UTF-8</value>
|
</list>
|
</property>
|
</bean>
|
</mvc:message-converters>
|
</mvc:annotation-driven>
|
<!-- 扫描controller(controller层注入) -->
|
<context:component-scan base-package="com.slcf.controller"/>
|
|
<!-- 不拦截静态资源 -->
|
<mvc:resources location="/images/" mapping="/images/**"></mvc:resources>
|
<mvc:resources location="/css/" mapping="/css/**"></mvc:resources>
|
<mvc:resources location="/js/" mapping="/js/**"></mvc:resources>
|
<mvc:resources location="/static/" mapping="/static/**"></mvc:resources>
|
<!-- 配置文件上传,如果没有使用文件上传可以不用配置,当然如果不配,那么配置文件中也不必引入上传组件包 -->
|
<bean id="multipartResolver"
|
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
<!-- 默认编码 -->
|
<property name="defaultEncoding" value="utf-8" />
|
<!-- 文件大小最大值 -->
|
<property name="maxUploadSize" value="10485760000" />
|
|
<!-- 内存中的最大值 -->
|
<property name="maxInMemorySize" value="40960" />
|
</bean>
|
|
<!-- 避免IE在ajax请求时,返回json出现下载 -->
|
<bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
|
<property name="supportedMediaTypes">
|
<list>
|
<value>text/html;charset=UTF-8</value>
|
</list>
|
</property>
|
</bean>
|
|
|
<!-- 对模型视图添加前后缀 -->
|
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
<property name="prefix" value="/WEB-INF/pages/" />
|
<property name="suffix" value=".jsp" />
|
</bean>
|
|
</beans>
|