多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
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
<?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:jdbc="http://www.springframework.org/schema/jdbc"
       xmlns:jee="http://www.springframework.org/schema/jee" xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx" xmlns:cache="http://www.springframework.org/schema/cache"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/cache
        http://www.springframework.org/schema/cache/spring-cache.xsd">
 
    <!-- 启动包扫描功能,以便注册带有@Controllers等注解的类成为spring的bean -->
    <context:component-scan base-package="com.ruili.**.controller,com.ruili.wcp.web.api,com.zbooksoft.**.controller"/>
 
    <!-- AOP 注解方式 ;定义Aspect -->
    <!-- 启动AspectJ支持 只对扫描过的bean有效 -->
    <aop:aspectj-autoproxy proxy-target-class="true"/>
 
    <!-- 全局异常处理类 -->
    <bean class="com.ruili.wcp.web.common.SpringHandlerExceptionResolver"/>
 
    <!-- 配置视图解析器 -->
    <bean
            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass"
                  value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix" value="/WEB-INF/view/"/>    <!-- 前缀 -->
        <property name="suffix" value=".jsp"/>    <!-- 后缀 -->
    </bean>
 
    <!-- 配置注解的处理器映射器和处理器适配器 -->
    <mvc:annotation-driven>
        <mvc:message-converters>
            <!-- 在输出到前台时,将long类型转换为string,以免精度丢失 -->
            <bean
                    class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                <property name="objectMapper">
                    <!-- <bean class="com.fasterxml.jackson.databind.ObjectMapper"> -->
                    <bean class="com.ruili.wcp.web.common.LongToStringAdapter">
                        <property name="dateFormat">
                            <bean class="java.text.SimpleDateFormat">
                                <constructor-arg type="java.lang.String" value="yyyy-MM-dd HH:mm:ss"/>
                            </bean>
                        </property>
                    </bean>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>
 
    <!-- 多部分文件上传 -->
    <bean id="multipartResolver"
          class="com.ruili.wcp.web.filter.CustomMultipartResolver">
        <property name="maxUploadSize" value="10737418240"/>
        <property name="maxInMemorySize" value="40960"/>
        <property name="defaultEncoding" value="UTF-8"/>
    </bean>
 
    <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/general/**"/>
            <bean class="com.ruili.wcp.web.interceptor.RequireLoginInterceptor">
                <property name="interceptorMappers" ref="interceptorMappers"/>
            </bean>
        </mvc:interceptor>
    </mvc:interceptors>
 
    <bean id="interceptorMappers" class="com.ruili.wcp.web.interceptor.RequireLoginInterceptor.InterceptorMappers">
        <property name="mappers" value="flag"/>
    </bean>
 
    <!-- 访问静态文件(jpg,js,css)的方法 -->
    <mvc:resources location="/static/" mapping="/static/**"/>
    <mvc:resources location="/upload/" mapping="/upload/**"/>
 
 
    <!-- 开启shiro注解 -->
    <bean
            class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
            depends-on="lifecycleBeanPostProcessor">
        <property name="proxyTargetClass" value="true"/>
    </bean>
 
    <bean
            class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
        <property name="securityManager" ref="securityManager"/>
    </bean>
</beans>