-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpringMVC.xml
More file actions
76 lines (66 loc) · 3.7 KB
/
Copy pathSpringMVC.xml
File metadata and controls
76 lines (66 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?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:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd">
<!-- 打开注解驱动开关 -->
<context:annotation-config />
<!-- 配置文件 -->
<bean class="com.caozj.common.CustomizedPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:/configs.properties</value>
</list>
</property>
</bean>
<!-- jsp渲染 -->
<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>
<!-- SpringMVC上传文件时,需要配置MultipartResolver处理器 -->
<bean id="multipartResolver" class="com.caozj.controller.uEditor.CustomMultipartResolver">
<!-- 指定所上传文件的总大小不能超过20M。注意maxUploadSize属性的限制不是针对单个文件,而是所有文件的容量之和 -->
<property name="maxUploadSize" value="20000000" />
<property name="excludeUrlPatternList">
<list>
<value>/uEditor/imageUp.do</value>
</list>
</property>
</bean>
<!-- 统一异常处理 -->
<bean class="com.caozj.common.CommonExceptionResolver" />
<!-- mvc拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**" />
<bean class="com.caozj.common.CommonInterceptor" />
</mvc:interceptor>
</mvc:interceptors>
<!-- mvc拦截器 <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**" /> <bean class="com.caozj.common.LoginInterceptor" /> </mvc:interceptor> <mvc:interceptor> <mvc:mapping path="/**" /> <bean class="com.caozj.common.PermissionInterceptor"
/> </mvc:interceptor> </mvc:interceptors> -->
<!-- mvc 注解 -->
<mvc:annotation-driven />
<!-- 静态资源 -->
<mvc:resources mapping="/js/**" location="/js/" />
<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/font/**" location="/font/" />
<mvc:resources mapping="/fonts/**" location="/fonts/" />
<mvc:resources mapping="/images/**" location="/images/" />
<mvc:resources mapping="/installPackage/**" location="/installPackage/" />
<mvc:resources mapping="/conf/**" location="/conf/" />
<mvc:resources mapping="/files/**" location="/files/" />
<mvc:resources mapping="/uEditor/**/*.js" location="/uEditor/" />
<mvc:resources mapping="/uEditor/**/*.html" location="/uEditor/" />
<mvc:resources mapping="/uEditor/**/*.css" location="/uEditor/" />
<mvc:resources mapping="/uEditor/**/*.png" location="/uEditor/" />
<mvc:resources mapping="/uEditor/**/*.gif" location="/uEditor/" />
<mvc:resources mapping="/uEditor/**/*.swf" location="/uEditor/" />
<mvc:resources mapping="/uEditor/**/*.exe" location="/uEditor/" />
<mvc:resources mapping="/favicon.ico" location="/favicon.ico" />
</beans>