<?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"
xsi:schemaLocation="
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd">
<!-- 启用spring mvc 注解 -->
<context:annotation-config />
<!-- 配置控制器扫描: controller包 -->
<context:component-scan base-package="com.gh" use-default-filters="false">
<!--只扫描控制器-->
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<context:property-placeholder location="classpath:video.properties"/>
<!--两个标准配置 -->
<!-- 将springmvc不能处理的请求交给tomcat -->
<mvc:default-servlet-handler/>
<!-- 配置注解驱动:用于代替映射器、适配器,支持springmvc更高级的功能:JSR303校验、快捷ajax、映射动态请求等 -->
<mvc:annotation-driven/>
<!--配置拦截器:对静态资源放行-->
<mvc:resources mapping="/ccs/**" location="/css/"/>
<mvc:resources mapping="/fonts/**" location="/fonts/"/>
<mvc:resources mapping="/js/**" location="/js/"/>
<!-- 完成请求和注解POJO的映射 注:org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter已废弃-->
<!--<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"></bean>-->
<!-- 配置视图解析器:prefix:前缀, suffix:后缀 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 配置前、后缀,前缀:JSP页面所在路径,后缀:是否是jsp页面 -->
<property name="prefix" value="/"></property><!--在路径后多加了条杠-->
<property name="suffix" value=".jsp"></property>
</bean>
<!-- 文件解析器 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8"></property>
<!-- 指定所上传的总大小不能超过xxx(B)。注意maxUploadSize属性的限制不是针对单个文件,而是所有文件 这里设置了10个G -->
<property name="maxUploadSize" value="10995116277760"></property>
</bean>
<!-- <bean id="jacksonMessageConverter"
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name = supportedMediaTypes ">
<list>
<value>text/html;charset=UTF-8</value>
</list>
</property>
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
</list>
</property>
</bean> -->
</beans>