//固定头部
<?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.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<!-- Json格式输出 start -->
<mvc:annotation-driven /> <!-- 使用Json后要加上这句,否则会报HttpMediaTypeNotAcceptableException错误-->
<!-- Json格式输出 end -->
<context:annotation-config />
<!-- 自动扫描bean,把作了注解的类转换为bean -->
<context:component-scan base-package="com.zyt.gyzt.*" />
<context:component-scan base-package="com.zyt.gyzt.service.checker" />
<!--采用MultipartResolver解析文件上传请求,利用MultipartFile来进行接收文件-->
<!--文件上传头部编码,默认是iso-8859-1-->
<property name="defaultEncoding" value="utf-8" />
<property name="maxUploadSize" value="25474565" /></bean>
class="org.springframework.web.servlet.mvc.annotation.RequestMappingHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="mappingJacksonHttpMessageConverter" />
</list>
</property>
</bean>
<bean id="mappingJacksonHttpMessageConverter"
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
</list>
</property>
</bean>
<!--拦截器-->
<mvc:interceptors>
<bean class="com.zyt.gyzt.interceptor.SessionInterceptor"></bean>
</mvc:interceptors>
</beans>