This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.xml
364 lines (325 loc) · 14.9 KB
/
web.xml
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- ========================================================== -->
<!-- General -->
<!-- ========================================================== -->
<!-- Name the application -->
<display-name>ATPPortal</display-name>
<description>An online portal for formulas with an interface to theorem provers</description>
<!-- Set timeout to 120 minutes -->
<session-config>
<session-timeout>120</session-timeout>
</session-config>
<!-- ========================================================== -->
<!-- Listeners -->
<!-- ========================================================== -->
<listener>
<!-- This listener starts the timers, so the ATPs are run -->
<!-- See the context params below -->
<listener-class>atpportal.ui.listeners.ApplicationContextListener</listener-class>
</listener>
<listener>
<!-- This listener initializes the tptp model, so that the servlets can use it -->
<!-- See the context params below -->
<listener-class>atpportal.ui.listeners.ModelInitializationListener</listener-class>
</listener>
<listener>
<listener-class>atpportal.ui.listeners.RoleSetterListener</listener-class>
</listener>
<!-- ========================================================== -->
<!-- Custom Tag Libraries -->
<!-- ========================================================== -->
<filter>
<filter-name>UTF8 Setter</filter-name>
<filter-class>atpportal.ui.filters.UTF8Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>UTF8 Setter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter>
<filter-name>AdminAuthorizationFilter</filter-name>
<filter-class>atpportal.ui.filters.AuthorizationFilter</filter-class>
<init-param>
<param-name>minimum_role</param-name>
<param-value>admin</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>AdminAuthorizationFilter</filter-name>
<url-pattern>/atp/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>AdminAuthorizationFilter</filter-name>
<url-pattern>/formula/makeAxiom.json</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>AdminAuthorizationFilter</filter-name>
<url-pattern>/account/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>AdminAuthorizationFilter</filter-name>
<url-pattern>/algebra/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter>
<filter-name>NormalAuthorizationFilter</filter-name>
<filter-class>atpportal.ui.filters.AuthorizationFilter</filter-class>
<init-param>
<param-name>minimum_role</param-name>
<param-value>normal</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>NormalAuthorizationFilter</filter-name>
<url-pattern>/queue/new</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>NormalAuthorizationFilter</filter-name>
<url-pattern>/formula/update.json</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<!-- ========================================================== -->
<!-- Custom Tag Libraries -->
<!-- ========================================================== -->
<!-- Taglib declarations are no longer required since JSP 2.0, see Removing taglib from web.xml -->
<!-- The <jsp-config> parent tag is also optional (taglib can be specified at the top level). -->
<!--
<jsp-config>
<taglib>
<taglib-uri>mytags</taglib-uri>
<taglib-location>/WEB-INF/jsp/mytaglib.tld</taglib-location>
</taglib>
</jsp-config>
-->
<!-- ========================================================== -->
<!-- Context Parameters -->
<!-- ========================================================== -->
<context-param>
<!-- The connection string for the database backend -->
<param-name>org.tptp.model.postgres.string</param-name>
<param-value>jdbc:postgresql://[::1]:5432/atpportal</param-value>
</context-param>
<context-param>
<!-- The driver class for the jdbc database backend -->
<param-name>org.tptp.model.postgres.class</param-name>
<param-value>org.postgresql.Driver</param-value>
</context-param>
<context-param>
<!-- The username for the database backend -->
<param-name>org.tptp.model.postgres.username</param-name>
<param-value>postgres</param-value>
</context-param>
<context-param>
<!-- The password string for the database backend -->
<param-name>org.tptp.model.postgres.password</param-name>
<param-value>postgres</param-value>
</context-param>
<context-param>
<!--
- How many parallel jobs should be executed to look for QUEUED jobs?
-
- Allowed values are integers and 'BY_PROCESSORS'
- BY_PROCESSORS = min(1, availableProcessors() -1 )
-->
<param-name>queue-worker</param-name>
<param-value>15</param-value>
</context-param>
<!-- ========================================================== -->
<!-- Servlets -->
<!-- ========================================================== -->
<servlet>
<!-- Identification -->
<servlet-name>atp</servlet-name>
<servlet-class>atpportal.ui.servlets.AtpServlet</servlet-class>
<description></description>
</servlet>
<servlet-mapping>
<servlet-name>atp</servlet-name>
<url-pattern>/atp/*</url-pattern>
</servlet-mapping>
<servlet>
<!-- Identification -->
<servlet-name>account</servlet-name>
<servlet-class>atpportal.ui.servlets.AccountServlet</servlet-class>
<description></description>
</servlet>
<servlet-mapping>
<servlet-name>account</servlet-name>
<url-pattern>/account/*</url-pattern>
</servlet-mapping>
<servlet>
<!-- Identification -->
<servlet-name>auth</servlet-name>
<servlet-class>atpportal.ui.servlets.AuthServlet</servlet-class>
<description>This performs the initial user authentication</description>
</servlet>
<servlet-mapping>
<servlet-name>auth</servlet-name>
<url-pattern>/auth/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>search</servlet-name>
<servlet-class>atpportal.ui.servlets.SearchServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>search</servlet-name>
<url-pattern>/search</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>search</servlet-name>
<url-pattern>/search.json</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>formula</servlet-name>
<servlet-class>atpportal.ui.servlets.FormulaServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>formula</servlet-name>
<url-pattern>/formula/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>queue</servlet-name>
<servlet-class>atpportal.ui.servlets.QueueServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>queue</servlet-name>
<url-pattern>/queue/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>dashboard</servlet-name>
<servlet-class>atpportal.ui.servlets.DashboardServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dashboard</servlet-name>
<url-pattern>/dashboard/</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>algebra</servlet-name>
<servlet-class>atpportal.ui.servlets.AlgebraServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>algebra</servlet-name>
<url-pattern>/algebra/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>proof</servlet-name>
<servlet-class>atpportal.ui.servlets.ProofServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>proof</servlet-name>
<url-pattern>/proof/*</url-pattern>
</servlet-mapping>
<!-- ========================================================== -->
<!-- Filters -->
<!-- ========================================================== -->
<!-- Example filter to set character encoding on each request (from Tomcat servlets-examples context) -->
<!--<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>filters.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>EUC_JP</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<!-- ========================================================== -->
<!-- Security -->
<!-- ========================================================== -->
<!-- Define roles -->
<!--<security-role>
<role-name>admin</role-name>
</security-role>
<security-role>
<role-name>user</role-name>
</security-role>
<security-constraint>
<display-name>Security constraint for the /algebra folder</display-name>
<web-resource-collection>
<web-resource-name>Algebra Administration</web-resource-name>
<url-pattern>/algebra/*</url-pattern>
-->
<!-- If you list http methods, only those methods are protected. -->
<!-- Leave this commented out to protect all access -->
<!--
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
-->
<!-- </web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
-->
<!-- FORM based authentication -->
<!-- Leave this commented out, we will use BASIC (HTTP) authentication instead -->
<!--
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
-->
<!-- Define a constraint to force SSL on all pages in the application -->
<!--
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
-->
<!-- ========================================================== -->
<!-- Error Handler -->
<!-- ========================================================== -->
<!-- Define an error handler for 404 pages -->
<!--
<error-page>
<error-code>404</error-code>
<location>/error404.jsp</location>
</error-page>
-->
<!-- Define an error handler for java.lang.Throwable -->
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error-page.jsp</location>
</error-page>
<!-- ========================================================== -->
<!-- Extra MIME types -->
<!-- ========================================================== -->
<!-- Set XML mime-mapping so spreadsheets open properly instead of being sent as an octet/stream -->
<mime-mapping>
<extension>xls</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>
<!-- ========================================================== -->
<!-- Welcome Files -->
<!-- ========================================================== -->
<!-- Define, in order of preference, which file to show when no filename is defined in the path -->
<!-- eg: when user goes to http://yoursite.com/ or http://yoursite.com/somefolder -->
<!-- Defaults are provided in the server-wide web.xml file, such as index.jsp, index.htm -->
<!-- Note: using this tag overrides the defaults, so don't forget to add them here -->
<welcome-file-list>
<!-- Use index.swf if present, or splash.jsp, otherwise just look for the normal defaults -->
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>