<?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
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.sxt"></context:component-scan>
<mvc:annotation-driven conversion-service="conversionService"></mvc:annotation-driven>
<!-- 拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/user/login.action"/>
<mvc:exclude-mapping path="/user/register.action"/>
<bean class="com.sxt.clouddisk.interceptor.MyInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
<!-- 转换器-->
<bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
<property name="converters">
<list>
<bean class="com.sxt.clouddisk.converter.MyDateConverter"></bean>
</list>
</property>
</bean>
<!--视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
<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>
<property name="maxInMemorySize" value="100000"></property>
</bean>
<!-- 异常解析器 -->
<bean id="handlerExceptionResolver" class="com.sxt.clouddisk.exception.CustomExceptionResolver"></bean>
</beans>
springmvc常规的配置文件
最新推荐文章于 2022-10-31 08:52:11 发布