You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
6.3 KiB

10 months ago
<?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"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
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/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-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/task
http://www.springframework.org/schema/task/spring-task-4.0.xsd">
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<context:component-scan base-package="com.fy.www._base,com.fy.www.admin.controller,com.fy.www.work.controller,com.fy.www.mobile.controller,com.fy.www.gis.controller,com.fy.www.bdata.controller,com.fy.www.exam.controller,com.fy.www.wechat.controller,com.fy.www.zc.controller"/>
<mvc:resources location="/_files/" mapping="/_files/**"/>
<mvc:resources location="/WEB-INF/" mapping="/WEB-INF/**"/>
<mvc:resources location="/zTree/" mapping="/zTree/**"/>
<mvc:resources location="/layui/" mapping="/layui/**"/>
<mvc:resources location="/style/" mapping="/style/**"/>
<mvc:resources location="/js/" mapping="/js/**"/>
<mvc:resources mapping="/*.xml" location="/" />
<mvc:resources mapping="/*.html" location="/" />
<mvc:resources mapping="/*.ico" location="/" />
<mvc:resources mapping="/**.txt" location="/txt/"/>
<mvc:resources location="/app/" mapping="/app/**"/>
<mvc:view-controller path="/" view-name="forward:/login"/>
<!--
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/jsp/"/>
<property name="suffix" value=".jsp"/>
<property name="order" value="1"/>
</bean>
-->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="utf-8"/>
<!--
maxInMemorySize 上传的缓存
maxUploadSize 最大文件上传大小
<property name="maxInMemorySize" value=""/>
<property name="maxUploadSize" value=""/>
-->
</bean>
<!-- freemarker配置 -->
<bean id="viewResolverFtl" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.freemarker.FreeMarkerView"/>
<property name="contentType" value="text/html;charset=UTF-8"/>
<property name="exposeRequestAttributes" value="true"/>
<property name="exposeSessionAttributes" value="true"/>
<property name="exposeSpringMacroHelpers" value="true"/>
<property name="requestContextAttribute" value="request"/>
<property name="allowRequestOverride" value="true"/>
<property name="allowSessionOverride" value="true"/>
<property name="cache" value="false"/>
<property name="prefix" value="/WEB-INF/ftl/"/>
<property name="suffix" value=".ftl"/>
<property name="order" value="0"/>
</bean>
<bean id="fmXmlEscape" class="freemarker.template.utility.XmlEscape"/>
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath" value="/"/>
<property name="freemarkerVariables">
<map>
<entry key="xml_escape" value-ref="fmXmlEscape"/>
</map>
</property>
<property name="defaultEncoding" value="UTF-8"/>
<property name="freemarkerSettings">
<props>
<prop key="template_update_delay">0</prop>
<prop key="default_encoding">UTF-8</prop>
<prop key="locale">UTF-8</prop><!--本地化设置 -->
<!--
<prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>
<prop key="date_format">yyyy-MM-dd</prop>
<prop key="time_format">HH:mm:ss</prop>
-->
<prop key="number_format">0.####</prop>
<prop key="boolean_format">true,false</prop>
<prop key="whitespace_stripping">true</prop>
<prop key="tag_syntax">auto_detect</prop>
<prop key="url_escaping_charset">UTF-8</prop>
<!--freemarker和spring国际化整合
<prop key="auto_import">spring.ftl as w</prop>
-->
</props>
</property>
</bean>
<!-- 国际化支持
<mvc:interceptors>
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang"/>
</bean>
</mvc:interceptors>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="ch"/>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:com/fy/web/language/language"/>
</bean>
-->
<!-- 拦截器
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/member/**"/>
<bean class="com.fy.web.interceptor.ViewsSessionInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/"/>
<bean class="com.fy.web.interceptor.ViewsVisitsInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
-->
</beans>