spring-mvc.xml
2.63 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
<?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:p="http://www.springframework.org/schema/p"
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.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<context:component-scan base-package="com.yoho" />
<mvc:annotation-driven />
<bean id="springContextUtil" class="com.yoho.unions.common.utils.SpringContextUtil" />
<bean id="memcachedClientFactory" class="com.yoho.core.cache.impl.MemcachedClientFactory">
<constructor-arg name="memcachedServers" value="${cache.servers.memcached.address}"/>
</bean>
<!-- 元宵节抽签活动写文件 -->
<bean class="com.yoho.activity.thread.DrawServiceThread" />
<!-- 装在properties文件 -->
<context:property-placeholder location="classpath*:config.properties" />
<!-- <bean id="restServiceBeanRegistry" class="com.yoho.core.rest.spring.RestServiceBeanRegistry">
<property name="registry" ref="serviceRegistry"></property>
</bean> -->
<bean id="serviceGlobalExceptionHandler" class="com.yoho.error.exception.handler.ServiceGlobalExceptionHandler"/>
<!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="stringConverter" />
<ref bean="jsonConverter" />
</list>
</property>
</bean>
<bean id="stringConverter"
class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list>
</property>
</bean>
<!-- 输出对象转JSON支持 -->
<bean id="jsonConverter"
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
</bean>
<mvc:interceptors>
<ref bean="securityInterceptor" />
<ref bean="threadProfileInterceptor"/>
</mvc:interceptors>
</beans>