spring-web.xml
5.21 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
default-autowire="byName">
<mvc:annotation-driven >
<mvc:argument-resolvers>
<bean class="com.diligrp.website.util.web.resolver.BeanArgumentResolver" />
</mvc:argument-resolvers>
<mvc:message-converters register-defaults="true">
<!-- 将StringHttpMessageConverter的默认编码设为UTF-8 -->
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
</bean>
<!-- 将Jackson2HttpMessageConverter的默认格式化输出设为true -->
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="prettyPrint" value="true"/>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<mvc:resources location="/static/**" mapping="/static/**" />
<!-- 视图解析器配置 -->
<bean id="velocityConfigurer"
class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath" value="/WEB-INF/views/" />
<property name="configLocation" value="classpath:velocity.properties" />
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="suffix" value=".vm" />
<property name="contentType" value="text/html;charset=UTF-8" />
</bean>
<bean id="securityUtils" class="com.diligrp.website.util.security.SecurityUtils">
<property name="verifyImgCodeURL" value="${project.verifycode.validate}"></property>
</bean>
<!-- 文件上传 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8" />
</bean>
<!--
<bean id="sessionContext" class="com.diligrp.manage.sdk.session.SessionContext" />
<bean id="cookieContext" class="com.diligrp.manage.sdk.cookie.CookieContext" />
-->
<bean id="velocityDefaultLayout" class="java.lang.String">
<constructor-arg value="${project.view.VMDefault}" />
</bean>
<bean id="dateFormatUtils" class="com.diligrp.website.util.format.DateFormatUtils" />
<bean id="moneyUtils" class="com.diligrp.website.util.format.MoneyUtils" />
<bean id="webUtils" class="com.diligrp.manage.manweb.utils.WebUtils">
<property name="assetsPath" value="${project.assets.path}" />
<property name="localPath" value="${project.domain.localPath}" />
<property name="verifyCodePath" value="${project.verifycode.path}" />
<property name="websiteDomain" value="${project.website.domain}" />
<property name="shopDomain" value="${project.shop.domain}" />
<property name="indexPath" value="${project.index.path}" />
<property name="messageListPath" value="${project.messageList.path}" />
<property name="messageAsyncPath" value="${project.message.async.path}" />
<property name="messageSyncPath" value="${project.message.sync.path}" />
<property name="msgUnreadPath" value="${project.message.unread.path}" />
</bean>
<!-- 注入操作日志实体 -->
<bean id="velocityTools" class="java.util.HashMap">
<constructor-arg>
<map>
<entry key="webUtils" value-ref="webUtils" />
<entry key="moneyUtils" value-ref="moneyUtils" />
<entry key="dateFormatUtils" value-ref="dateFormatUtils" />
</map>
</constructor-arg>
</bean>
<!--<mvc:interceptors>-->
<!--<mvc:interceptor>-->
<!--<mvc:mapping path="/**"/>-->
<!--<mvc:exclude-mapping path="/noAccess.do"/>-->
<!--<mvc:exclude-mapping path="/welcome.do"/>-->
<!--<mvc:exclude-mapping path="/loginControl/**"/>-->
<!--<mvc:exclude-mapping path="/api/**"/>-->
<!--<bean class="com.diligrp.manage.sdk.session.SessionInterceptor">-->
<!--<property name="enabled" value="true"/>-->
<!--</bean>-->
<!--</mvc:interceptor>-->
<!--<mvc:interceptor>-->
<!--<mvc:mapping path="/**"/>-->
<!--<mvc:exclude-mapping path="/noAccess.do"/>-->
<!--<mvc:exclude-mapping path="/welcome.do"/>-->
<!--<mvc:exclude-mapping path="/loginControl/**"/>-->
<!--<mvc:exclude-mapping path="/api/**"/>-->
<!--<bean class="com.diligrp.manage.sdk.interceptor.LoginInterceptor">-->
<!--</bean>-->
<!--</mvc:interceptor>-->
<!--<mvc:interceptor>-->
<!--<mvc:mapping path="/**"/>-->
<!--<mvc:exclude-mapping path="/main.do"/>-->
<!--<mvc:exclude-mapping path="/api/**"/>-->
<!--<bean class="com.diligrp.manage.sdk.interceptor.PermissionInterceptor">-->
<!--</bean>-->
<!--</mvc:interceptor>-->
<!--</mvc:interceptors>-->
</beans>