<?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/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd">
<!-- 扫描所有的controller -->
<context:component-scan base-package="com.ac.test.controller"/>
<!-- 不处理静态资源 -->
<mvc:default-servlet-handler />
<!-- 使用默认的配置管理HandleMapping和HandleAdapter等,
即spring的核心处理机制,如果需要自定义,可以手动配置HandleMapping和HandleAdapter -->
<mvc:annotation-driven />
<!-- 配置文件上传 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 配置文件上传的最大体积 -->
<property name="maxUploadSize" value="102400000"></property>
</bean>
<!-- 配置视图的位置(即前缀和后缀) -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
id="internalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/pages/" />
<!-- 后缀 -->
<property name="suffix" value=".jsp" />
</bean>
</beans>
SpringMVC 配置文件
最新推荐文章于 2021-08-17 17:19:42 发布