myshop-intelij/web/WEB-INF/springMVC-config.xml

26 lines
1.4 KiB
XML
Raw Normal View History

2023-11-14 15:03:36 +08:00
<?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.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- 扫描Controller -->
2023-11-15 13:39:00 +08:00
<context:component-scan base-package="com.landaiqing.controller" />
2023-11-14 15:03:36 +08:00
<!-- 配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="suffix" value=".jsp" />
</bean>
<mvc:annotation-driven/>
<mvc:default-servlet-handler></mvc:default-servlet-handler>
<!-- SpringMVC上传文件时需要配置MultipartResolver处理器 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8" />
<!-- 指定所上传文件的总大小,单位字节。注意maxUploadSize属性的限制不是针对单个文件而是所有文件的容量之和 -->
<property name="maxUploadSize" value="10240000" />
</bean>
</beans>