From 0fa3a0d994370e35d167750ac2c89b1d7613d68d Mon Sep 17 00:00:00 2001
From: pw52ag3q9 <2861084142@qq.com>
Date: Sat, 29 Apr 2023 21:05:52 +0800
Subject: [PATCH] Update springMVC.xml

---
 src/main/resources/springMVC.xml | 43 ++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/main/resources/springMVC.xml b/src/main/resources/springMVC.xml
index 12bbf74..b006499 100644
--- a/src/main/resources/springMVC.xml
+++ b/src/main/resources/springMVC.xml
@@ -1 +1,44 @@
 <?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-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.2.xsd">
+
+    <!--启动注解识别-->
+    <context:annotation-config/>
+
+    <context:component-scan base-package="com.how2java.tmall.controller">
+        <context:include-filter type="annotation"
+                                expression="org.springframework.stereotype.Controller"/>
+    </context:component-scan>
+
+    <mvc:annotation-driven />
+
+    <!--开通静态资源的访问-->
+    <mvc:default-servlet-handler />
+
+    <!-- 视图定位 -->
+    <bean
+            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <property name="viewClass"
+                  value="org.springframework.web.servlet.view.JstlView" />
+        <property name="prefix" value="/WEB-INF/jsp/" />
+        <property name="suffix" value=".jsp" />
+    </bean>
+
+    <!-- 对上传文件的解析-->
+    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
+    <mvc:interceptors>
+        <mvc:interceptor>
+            <mvc:mapping path="/fore*"/>
+            <bean class="com.how2java.tmall.interceptor.LoginInterceptor"/>
+        </mvc:interceptor>
+        <mvc:interceptor>
+            <mvc:mapping path="/fore*"/>
+            <bean class="com.how2java.tmall.interceptor.OtherInterceptor"/>
+        </mvc:interceptor>
+    </mvc:interceptors>
+</beans>