spring applicationContext.xml

时间:2023-03-10 06:30:42
spring applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<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: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.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd ">
<bean id="propertyConfigurer"
class="com.inborn.inshop.common.config.CustomizedPropertyConfigurer">
<property name="locations">
<list>
<value>classpath:db.properties</value>
<value>classpath:email.properties</value>
<value>classpath:aliyun.properties</value>
<value>classpath:param.properties</value>
<value>classpath:app.properties</value>
<value>classpath:base.properties</value>
<value>classpath:pay.properties</value>
<value>classpath:es.properties</value>
<value>classpath:sf.properties</value>
<value>classpath:commonParam.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>
<!-- 数据源 -->
<import resource="classpath*:/spring/spring-config-datasource.xml" />
<!-- 邮件 -->
<import resource="classpath*:/spring/spring-email.xml" />

<!--&lt;!&ndash; 模板 &ndash;&gt;-->
<!--<import resource="classpath*:/spring/spring-freeMarker.xml" />-->
<!-- 事务 -->
<import resource="classpath*:/spring/spring-config-service.xml" />
<!-- 缓存 -->
<import resource="classpath*:/spring/spring-redis.xml" />

<import resource="classpath*:/spring/es_applicationContext.xml" />

<mvc:annotation-driven>
<mvc:message-converters>
<bean id="fastJsonHttpMessageConverter"
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
<bean id="stringHttpMessageConverter"
class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>

<bean id="userInterceptor" class="com.inborn.inshop.interceptor.UserInterceptor">
</bean>
<mvc:interceptors>
<ref bean="userInterceptor"/>
</mvc:interceptors>
<!-- 上传附件 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="utf-8" />
<!-- 上传最大限制 20M-->
<property name="maxUploadSize" value="20971520" />
<property name="maxInMemorySize" value="40960" />
<!-- resolveLazily属性启用是为了推迟文件解析,以便在UploadAction 中捕获文件大小异常-->
<property name="resolveLazily" value="true"/>
</bean>

<context:component-scan base-package="com.inborn.inshop" />

<!--<bean id="loadSystem" class="com.code.init.LoadSystem" init-method="init" /> -->
<!-- 异常处理类 -->
<bean class="com.inborn.inshop.handler.GlobalDefaultExceptionHandler"/>
</beans>