zj
2024-06-03 4afe73cb84c5a609662b8b4ee20693de9b86b9a3
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
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">
 
    <display-name>stock2c1</display-name>
 
    <filter>
        <description>跨域过滤器</description>
        <filter-name>CORS</filter-name>
        <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
        <init-param>
            <param-name>cors.allowOrigin</param-name>
            <param-value>*</param-value>
        </init-param>
        <init-param>
            <param-name>cors.supportedMethods</param-name>
            <param-value>GET, POST, HEAD, PUT, DELETE</param-value>
        </init-param>
        <init-param>
            <param-name>cors.supportedHeaders</param-name>
            <param-value>Accept, Origin, X-Requested-With, Content-Type, Last-Modified</param-value>
        </init-param>
        <init-param>
            <param-name>cors.exposedHeaders</param-name>
            <param-value>Set-Cookie</param-value>
        </init-param>
        <init-param>
            <param-name>cors.supportsCredentials</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CORS</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 
 
    <!--跨域请求过滤器 filter-->
    <!--<filter>-->
    <!--<filter-name>crossDomainFilter</filter-name>-->
    <!--<filter-class>classes.com.nq.common.filter.CrossFilter</filter-class>-->
    <!--<init-param>-->
    <!--<param-name>targetFilterLifecycle</param-name>-->
    <!--<param-value>true</param-value>-->
    <!--</init-param>-->
    <!--</filter>-->
    <!--<filter-mapping>-->
    <!--<filter-name>crossDomainFilter</filter-name>-->
    <!--<url-pattern>/*</url-pattern> &lt;!&ndash;可以针对某个接口进行限制&ndash;&gt;-->
    <!--</filter-mapping>-->
 
 
    <!--characterEncodingFilter-->
    <filter>
        <filter-name>characterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <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>
    <filter-mapping>
        <filter-name>characterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 
    <session-config>
        <session-timeout>15</session-timeout>
    </session-config>
 
    <!--重置redis session有效时间filter-->
    <filter>
        <filter-name>sessionExpireFilter</filter-name>
        <filter-class>com.nq.common.filter.SessionExpireFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>sessionExpireFilter</filter-name>
        <url-pattern>*.do</url-pattern>
    </filter-mapping>
    <!--spring session framework-->
    <!--<filter>-->
    <!--<filter-name>springSessionRepositoryFilter</filter-name>-->
    <!--<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>-->
    <!--</filter>-->
    <!--<filter-mapping>-->
    <!--<filter-name>springSessionRepositoryFilter</filter-name>-->
    <!--<url-pattern>*.do</url-pattern>-->
    <!--</filter-mapping>-->
 
    <!--监听web容器启动和关闭的监听器-->
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
 
    <!--web容器和spring容器进行整合的listener-->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
 
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:applicationContext.xml
        </param-value>
    </context-param>
 
 
    <!--dispatcher servlet-->
    <!--<servlet>-->
    <!--<servlet-name>dispatcher</servlet-name>-->
    <!--<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>-->
    <!--这里可以修改dispatcher servlet的路径-->
    <!--<init-param>-->
    <!--<param-name>contextConfigLocation</param-name>-->
    <!--<param-value>/WEB-INF/XXX.xml</param-value>-->
    <!--</init-param>-->
    <!--<load-on-startup>1</load-on-startup>-->
    <!--</servlet>-->
    <!--<servlet-mapping>-->
    <!--<servlet-name>dispatcher</servlet-name>-->
    <!--<url-pattern>*.do</url-pattern>-->
    <!--</servlet-mapping>-->
 
    <!--过滤XSS攻击 -->
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>com.nq.security.xss.DispatcherServletWrapper</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
 
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>
 
 
 
    <!--如果是改成restful接口,这里要配置成/-->
    <!--<servlet-mapping>-->
    <!--<servlet-name>dispatcher</servlet-name>-->
    <!--<url-pattern>/</url-pattern>-->
    <!--</servlet-mapping>-->
 
 
    <!--错误page-->
    <!--<error-page>-->
    <!--<error-code>404</error-code>-->
    <!--<location>/WEB-INF/error/404.html</location>-->
    <!--</error-page>-->
    <!--<error-page>-->
    <!--<error-code>500</error-code>-->
    <!--<location>/WEB-INF/error/404.html</location>-->
    <!--</error-page>-->
 
 
 
</web-app>