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.
218 lines
10 KiB
218 lines
10 KiB
2 years 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:p="http://www.springframework.org/schema/p"
|
||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||
|
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
|
||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||
|
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
|
||
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
|
||
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
||
|
|
||
|
<!--静态资源配置 -->
|
||
|
<!-- <mvc:resources mapping="/assets/**" location="/assets/" cache-period="31556926"/>
|
||
|
<mvc:resources mapping="/css/**" location="/css/" cache-period="31556926"/>
|
||
|
<mvc:resources mapping="/js/**" location="/js/" cache-period="31556926"/>
|
||
|
<mvc:resources mapping="/images/**" location="/images/" cache-period="31556926"/>
|
||
|
<mvc:resources mapping="/login/**" location="/login/" cache-period="31556926"/> -->
|
||
|
<!-- <mvc:view-controller path="/" view-name="/login/doLogin.do" /> -->
|
||
|
<!-- Spring MVC不处理静态资源 -->
|
||
|
|
||
|
<mvc:default-servlet-handler/>
|
||
|
<aop:aspectj-autoproxy/>
|
||
|
|
||
|
<!-- 支持mvc注解驱动 -->
|
||
|
|
||
|
<mvc:annotation-driven conversion-service="conversionService"/>
|
||
|
|
||
|
<bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
|
||
|
<property name="converters">
|
||
|
<list>
|
||
|
</list>
|
||
|
</property>
|
||
|
</bean>
|
||
|
|
||
|
<!--自动注释 -->
|
||
|
<!-- <context:annotation-config /> -->
|
||
|
<!-- 设置使用注解的类所在的jar包 -->
|
||
|
<!-- <context:component-scan base-package="com.cjy.*" use-default-filters="false"></context:component-scan> -->
|
||
|
<context:component-scan base-package="com.cjy.*">
|
||
|
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
|
||
|
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
|
||
|
</context:component-scan>
|
||
|
|
||
|
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
|
||
|
|
||
|
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/hbcyjc/"
|
||
|
p:suffix=".jsp"/>
|
||
|
|
||
|
<mvc:interceptors>
|
||
|
<mvc:interceptor>
|
||
|
<mvc:mapping path="/**"/>
|
||
|
<bean class="pers.zero.util.spring.autorelease.interceptor.AutoReleaseInterceptor"/>
|
||
|
</mvc:interceptor>
|
||
|
|
||
|
<!-- session超时 -->
|
||
|
<mvc:interceptor>
|
||
|
<mvc:mapping path="/**"/>
|
||
|
<bean class="com.cjy.interceptor.AdminInterceptor">
|
||
|
<property name="loginUrl" value="/login/doLogin.do"/>
|
||
|
<property name="allowUrls">
|
||
|
<list>
|
||
|
<value>/hbcyjclogin</value>
|
||
|
<value>/yjzh/mobile</value>
|
||
|
<value>/yjgltask/uploadTask.do</value>
|
||
|
<value>/daily</value>
|
||
|
<value>/weatherInfo</value>
|
||
|
<value>/api</value>
|
||
|
|
||
|
<!--移动端任务上报 url -->
|
||
|
<value>/yjzh/moblie/trsk.do</value>
|
||
|
<value>/yjzh/moblie/selectTaskInfo.do</value>
|
||
|
<value>/yjzh/moblie/uploadfile.do</value>
|
||
|
<value>/yjzh/moblie/selectTaskList.do</value>
|
||
|
<value>/yjzh/moblie/trskList.do</value>
|
||
|
<value>/login</value>
|
||
|
<value>/js</value>
|
||
|
<value>/css</value>
|
||
|
<value>/image</value>
|
||
|
|
||
|
<value>/icons</value>
|
||
|
<value>/images</value>
|
||
|
<value>/img</value>
|
||
|
<value>/img2</value>
|
||
|
<value>/weather</value>
|
||
|
<value>/xiongan.jsp</value>
|
||
|
<value>/upload/video</value>
|
||
|
<value>/videomanager</value>
|
||
|
<!-- 错误页面 -->
|
||
|
<value>/error-page</value>
|
||
|
<!-- 阅信 短信 接口 -->
|
||
|
<value>/yuexinsms</value>
|
||
|
<!-- <value>/yjzh/moblie/trsk.do</value> -->
|
||
|
<value>/yjzh/moblie/trsk.do</value>
|
||
|
|
||
|
<!-- 登录地名过滤 -->
|
||
|
<!-- 雄安 -->
|
||
|
<value>/xiongan</value>
|
||
|
<!-- 饶阳 -->
|
||
|
<value>/raoyang</value>
|
||
|
<!-- 香河 -->
|
||
|
<value>/xianghe</value>
|
||
|
<!-- 衡水 -->
|
||
|
<value>/hengshui</value>
|
||
|
<!-- 涞源 -->
|
||
|
<value>/laiyuan</value>
|
||
|
<!-- 沽源 -->
|
||
|
<value>/guyuan</value>
|
||
|
<!-- 安平 -->
|
||
|
<value>/anping</value>
|
||
|
<!-- 河北 -->
|
||
|
<value>/hebei</value>
|
||
|
|
||
|
<value>/theme/common</value>
|
||
|
<value>/api/v1/mobile</value>
|
||
|
|
||
|
<value>/zhspjkvideomanage</value>
|
||
|
|
||
|
<!-- 车流量 开放接口..-->
|
||
|
<value>/realtimeCllnums/open/ssnums</value>
|
||
|
<!-- 视频监控 开放接口..-->
|
||
|
<value>/video/export/get-rate</value>
|
||
|
<!-- 短连接开放接口 -->
|
||
|
<value>/sl</value>
|
||
|
|
||
|
<value>/zhspjkvideomanage</value>
|
||
|
|
||
|
<!-- 车流量 开放接口..-->
|
||
|
<value>/realtimeCllnums/open/ssnums</value>
|
||
|
<!-- 视频监控 开放接口..-->
|
||
|
<value>/video/export/get-rate</value>
|
||
|
<!-- 短连接开放接口 -->
|
||
|
<value>/sl</value>
|
||
|
<!-- 雄安一票通游-->
|
||
|
<value>/onetickettour</value>
|
||
|
<value>/byd_one_ticket_tour</value>
|
||
|
</list>
|
||
|
</property>
|
||
|
</bean>
|
||
|
</mvc:interceptor>
|
||
|
</mvc:interceptors>
|
||
|
|
||
|
|
||
|
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
|
||
|
<property name="exceptionMappings">
|
||
|
<props>
|
||
|
<!-- 遇到MaxUploadSizeExceededException异常时,自动跳转到/WEB-INF/jsp/error_fileupload.jsp页面 -->
|
||
|
<prop key="org.springframework.web.multipart.MaxUploadSizeExceededException"></prop>
|
||
|
</props>
|
||
|
</property>
|
||
|
</bean>
|
||
|
|
||
|
<!-- json 转换 -->
|
||
|
<bean id="fastJsonHttpMessageConverterBean"
|
||
|
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
|
||
|
<property name="supportedMediaTypes">
|
||
|
<list>
|
||
|
<!-- 这里顺序不能反,一定先写text/html,不然ie下出现下载提示 -->
|
||
|
<value>application/json;charset=UTF-8</value>
|
||
|
<!--<value>text/html;charset=UTF-8</value>-->
|
||
|
</list>
|
||
|
</property>
|
||
|
<property name="features">
|
||
|
<array>
|
||
|
<!--输出key时是否使用双引号,默认为true-->
|
||
|
<value>QuoteFieldNames</value>
|
||
|
<!--全局修改日期格式-->
|
||
|
<value>WriteDateUseDateFormat</value>
|
||
|
<!--按照toString方式获取对象字面值-->
|
||
|
<value>WriteNonStringKeyAsString</value>
|
||
|
<!-- 字段如果为null,输出为"",而非null -->
|
||
|
<value>WriteNullStringAsEmpty</value>
|
||
|
<value>WriteNullBooleanAsFalse</value>
|
||
|
<value>WriteNullListAsEmpty</value>
|
||
|
<value>WriteNullNumberAsZero</value>
|
||
|
<value>WriteMapNullValue</value>
|
||
|
</array>
|
||
|
</property>
|
||
|
</bean>
|
||
|
|
||
|
<!-- 启动Springmvc注解驱动 -->
|
||
|
<mvc:annotation-driven/>
|
||
|
<!-- 返回json 方法一 需要导入 fastjson.jar包 -->
|
||
|
|
||
|
|
||
|
<!-- 默认的注解映射的支持 -->
|
||
|
<mvc:annotation-driven validator="validator" conversion-service="conversion-service">
|
||
|
<mvc:message-converters>
|
||
|
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
|
||
|
<constructor-arg index="0" value="UTF-8"/>
|
||
|
<property name="writeAcceptCharset" value="false"/>
|
||
|
</bean>
|
||
|
|
||
|
<!-- fast json 解析器 -->
|
||
|
<ref bean="fastJsonHttpMessageConverterBean"/>
|
||
|
|
||
|
</mvc:message-converters>
|
||
|
|
||
|
|
||
|
</mvc:annotation-driven>
|
||
|
|
||
|
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
|
||
|
<property name="providerClass" value="org.hibernate.validator.HibernateValidator"/>
|
||
|
<!--不设置则默认为classpath下的 ValidationMessages.properties -->
|
||
|
<property name="validationMessageSource" ref="validatemessageSource"/>
|
||
|
</bean>
|
||
|
<bean id="conversion-service" class="org.springframework.format.support.FormattingConversionServiceFactoryBean"/>
|
||
|
<bean id="validatemessageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
|
||
|
<property name="basename" value="classpath:/config/validatemessages"/>
|
||
|
<property name="fileEncodings" value="utf-8"/>
|
||
|
<property name="cacheSeconds" value="120"/>
|
||
|
</bean>
|
||
|
<!-- 文件上传控制 -->
|
||
|
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||
|
<property name="defaultEncoding" value="utf-8"></property>
|
||
|
<property name="maxUploadSize" value="-1"></property>
|
||
|
<property name="maxInMemorySize" value="4096000"></property>
|
||
|
</bean>
|
||
|
</beans>
|