cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
 
    <!--  Spring 服务层的配置文件 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext*.xml</param-value>
    </context-param>
 
    <!--  Spring 容器启动监听器 -->
    <listener>
        <listener-class>cn.ksource.web.listener.SysContextListener</listener-class>
    </listener>
 
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>
 
    <context-param>
        <param-name>webAppRootKey</param-name>
        <param-value>SpringMVC.root</param-value>
    </context-param>
 
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>classpath:log4j.properties</param-value>
    </context-param>
 
    <listener>
        <listener-class>
            org.springframework.web.util.Log4jConfigListener
        </listener-class>
    </listener>
 
 
    <!-- 使用tomcat默认的servlet处理静态资源
        该默认servlet映射必须在springmvc之前
     
    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>.*</url-pattern>
    </servlet-mapping>
 -->
    <servlet>
        <servlet-name>SpringMVC</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:SpringMVC-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported>
    </servlet>
    <!--为DispatcherServlet建立映射 -->
    <servlet-mapping>
        <servlet-name>SpringMVC</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>
 
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <async-supported>true</async-supported>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <!-- encoding filter for jsp page -->
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 
 
    <servlet>
        <servlet-name>Kaptcha</servlet-name>
        <servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class>
 
        <!--
            For a complete list of Init Parameters, please see:
            http://code.google.com/p/kaptcha/wiki/ConfigParameters
        -->
        <init-param>
            <param-name>kaptcha.textproducer.char.string</param-name>
            <param-value>0123456789</param-value>
        </init-param>
        <init-param>
            <param-name>kaptcha.border</param-name>
            <param-value>no</param-value>
        </init-param>
 
        <init-param>
            <param-name>kaptcha.textproducer.font.color</param-name>
            <param-value>black</param-value>
        </init-param>
 
        <init-param>
            <param-name>kaptcha.textproducer.char.space</param-name>
            <param-value>5</param-value>
        </init-param>
        <init-param>
            <param-name>kaptcha.textproducer.char.length</param-name>
            <param-value>4</param-value>
        </init-param>
    </servlet>
    <servlet>
        <description>This is the description of my J2EE component</description>
        <display-name>This is the display name of my J2EE component</display-name>
        <servlet-name>IndexServlet</servlet-name>
        <servlet-class>cn.ksource.IndexServlet</servlet-class>
    </servlet>
 
 
    <servlet-mapping>
        <servlet-name>Kaptcha</servlet-name>
        <url-pattern>*.validatecode</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>IndexServlet</servlet-name>
        <url-pattern>/index</url-pattern>
    </servlet-mapping>
 
    <!-- 管理员登录控制  -->
    <filter>
        <filter-name>UserLoginFilter</filter-name>
        <filter-class>cn.ksource.core.web.LoginUserFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>UserLoginFilter</filter-name>
        <url-pattern>/business/pages/*</url-pattern>
    </filter-mapping>
 
    <!-- 用户中心登录控制  -->
    <filter>
        <filter-name>WebUserLoginFilter</filter-name>
        <filter-class>cn.ksource.core.web.WebLoginUserFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>WebUserLoginFilter</filter-name>
        <url-pattern>/uc/*</url-pattern>
    </filter-mapping>
 
    <!-- 微信微运维用户登录控制  -->
    <filter>
        <filter-name>WywUserLoginFilter</filter-name>
        <filter-class>cn.ksource.core.web.WywLoginUserFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>WywUserLoginFilter</filter-name>
        <url-pattern>/uwyw/*</url-pattern>
    </filter-mapping>
 
 
    <!-- 微信微运维工程师登录控制  -->
    <filter>
        <filter-name>WywUserEngineerLoginFilter</filter-name>
        <filter-class>cn.ksource.core.web.WywEngineerLoginFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>WywUserEngineerLoginFilter</filter-name>
        <url-pattern>/ewyw/*</url-pattern>
    </filter-mapping>
 
 
    <!-- 拦截所有的链接 -->
    <!--
    <filter>
         <filter-name>WebFilter</filter-name>
         <filter-class>cn.ksource.core.web.WebFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>WebFilter</filter-name>
        <url-pattern>/*</url-pattern>
     </filter-mapping>
      -->
 
 
    <listener>
        <listener-class>cn.ksource.core.web.OnlineUserListener</listener-class>
    </listener>
 
    <welcome-file-list>
        <welcome-file>/business/login.html</welcome-file>
    </welcome-file-list>
    <error-page>
        <error-code>404</error-code>
        <location>/business/error/404.jsp</location>
    </error-page>
 
 
</web-app>