1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | |
---|
3 | <!-- |
---|
4 | This file contains the standard Java Web Application Server application |
---|
5 | definitions for the IBIS-PH View application. See the admin app's |
---|
6 | web.xml for detailed comments that describes how requests flow, spring |
---|
7 | configuration, JNDI resources - info about webapp configuration. |
---|
8 | |
---|
9 | The configuration implemented in this file contains a basic configuration |
---|
10 | with remote publishing and NO user security (but publishing security). |
---|
11 | |
---|
12 | NOTE: Direct file publishing can be configured for the admin app without |
---|
13 | impacting (having to do any reconfiguration) this application's publishing |
---|
14 | configuration. Put another way, if the admin is configured to publish |
---|
15 | directly to this applications XML directory then this application never |
---|
16 | receives a publish request so the view app's remote publishing is never |
---|
17 | invoked - so it doesn't matter if it is setup or properly configured as it |
---|
18 | will never be hit (so the site specific publish related configuration |
---|
19 | properties could be ignored but only IF the admin app uses direct publishing). |
---|
20 | --> |
---|
21 | |
---|
22 | <web-app |
---|
23 | version="2.5" |
---|
24 | xmlns="http://java.sun.com/xml/ns/javaee" |
---|
25 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
---|
26 | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" |
---|
27 | > |
---|
28 | |
---|
29 | <icon> |
---|
30 | <small-icon>image/application.ico</small-icon> |
---|
31 | <large-icon>image/application.ico</large-icon> |
---|
32 | </icon> |
---|
33 | <display-name>IBIS-PH - Public View</display-name> |
---|
34 | <description> |
---|
35 | Indicator Based Information System for Public Health (IBIS-PH). This |
---|
36 | system provides internet access for the public to view health indicator |
---|
37 | data and to create and execute custom data queries. The data presented |
---|
38 | are stored in XML files with the HTML view being created by XSLTs and |
---|
39 | controlled via Java controllers built on the Spring framework. |
---|
40 | </description> |
---|
41 | <distributable/> |
---|
42 | |
---|
43 | |
---|
44 | <!-- =========================================== J N D I R E S O U R C E S --> |
---|
45 | <!-- not all adopters will use a db. this is provided for those who do: |
---|
46 | <resource-ref> |
---|
47 | <description>Resource reference to the app server container managed JNDI database connection factory</description> |
---|
48 | <res-ref-name>jdbc/doh_ibisph</res-ref-name> |
---|
49 | <res-ref-type>javax.sql.DataSource</res-ref-type> |
---|
50 | <res-auth>Container</res-auth> |
---|
51 | </resource-ref> |
---|
52 | --> |
---|
53 | <resource-ref> |
---|
54 | <description>Resource reference to the app server container managed JNDI JavaMail factory</description> |
---|
55 | <res-ref-name>mail/doh_ibisph</res-ref-name> |
---|
56 | <res-type>javax.mail.Session</res-type> |
---|
57 | <res-auth>Container</res-auth> |
---|
58 | <res-sharing-scope>Shareable</res-sharing-scope> |
---|
59 | </resource-ref> |
---|
60 | |
---|
61 | |
---|
62 | <!-- ========================================== C O N T E X T - P A R A M S --> |
---|
63 | <!-- Values used by the listeners --> |
---|
64 | <context-param> |
---|
65 | <param-name>logbackConfigLocation</param-name> |
---|
66 | <param-value>/WEB-INF/config/logback.xml</param-value> |
---|
67 | </context-param> |
---|
68 | |
---|
69 | <context-param> |
---|
70 | <description> |
---|
71 | Defines the global, app context wide Spring application context |
---|
72 | definition files to be used for the application. These files are |
---|
73 | Spring bean definitions which will be loaded by the Spring Bean |
---|
74 | Factory and are availaable to any object within the app. |
---|
75 | |
---|
76 | See the context listener defined below which uses this param (list). |
---|
77 | |
---|
78 | Optional context files: |
---|
79 | /WEB-INF/config/spring/security-db_authentication.xml |
---|
80 | /WEB-INF/config/spring/https.xml |
---|
81 | </description> |
---|
82 | <param-name>contextConfigLocation</param-name> |
---|
83 | <param-value> |
---|
84 | /WEB-INF/config/spring/common.xml |
---|
85 | /WEB-INF/config/spring/filter.xml |
---|
86 | |
---|
87 | /WEB-INF/config/spring/security.xml |
---|
88 | /WEB-INF/config/spring/security-pre_authentication.xml |
---|
89 | /WEB-INF/config/spring/security-xml_authentication.xml |
---|
90 | </param-value> |
---|
91 | </context-param> |
---|
92 | |
---|
93 | |
---|
94 | <!-- ===================================================== L I S T E N E R S --> |
---|
95 | <listener> |
---|
96 | <listener-class>org.ibisph.log.ConfigureLogbackListener</listener-class> |
---|
97 | </listener> |
---|
98 | |
---|
99 | <listener> |
---|
100 | <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
---|
101 | </listener> |
---|
102 | |
---|
103 | <listener> |
---|
104 | <description> |
---|
105 | Publishes events for session creation and destruction through the app |
---|
106 | context. Optional unless concurrent session control is being used. |
---|
107 | </description> |
---|
108 | <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class> |
---|
109 | </listener> |
---|
110 | |
---|
111 | |
---|
112 | <!-- ========================================================= F I L T E R S --> |
---|
113 | <filter> |
---|
114 | <filter-name>StandardFilters</filter-name> |
---|
115 | <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> |
---|
116 | <init-param> |
---|
117 | <param-name>targetBeanName</param-name> |
---|
118 | <param-value>Filter.FilterChainProxy</param-value> |
---|
119 | </init-param> |
---|
120 | </filter> |
---|
121 | <filter> |
---|
122 | <filter-name>SecurityFilters</filter-name> |
---|
123 | <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> |
---|
124 | <init-param> |
---|
125 | <param-name>targetBeanName</param-name> |
---|
126 | <param-value>Security.FilterChainProxy</param-value> |
---|
127 | </init-param> |
---|
128 | </filter> |
---|
129 | |
---|
130 | |
---|
131 | <!-- ========================================= F I L T E R M A P P I N G S --> |
---|
132 | <!-- The standard filters provide response compression (gzip), header |
---|
133 | modifications for stuffing graphic types and cookie values, and to |
---|
134 | handle other request/response manipulations. The security filters |
---|
135 | provide authentication and authorization protection for the web URL/ |
---|
136 | resource via Spring Security filters. Both types of filtering are |
---|
137 | handled at a high level with Spring's delegating filter. Spring's |
---|
138 | delegating proxy filter provides 2 important capabilities not found in |
---|
139 | standard web.xml filter mappings: 1) more flexible URL to filter |
---|
140 | mappings, and 2) the ability to configure filters using spring |
---|
141 | injection. Each filter definition has the detailed filter mappings |
---|
142 | which makes this web.xml simplier and allows the filters to all be |
---|
143 | contained in one area and easier to maintain. |
---|
144 | --> |
---|
145 | <filter-mapping> |
---|
146 | <filter-name>StandardFilters</filter-name> |
---|
147 | <url-pattern>*</url-pattern> |
---|
148 | </filter-mapping> |
---|
149 | <filter-mapping> |
---|
150 | <filter-name>SecurityFilters</filter-name> |
---|
151 | <url-pattern>*</url-pattern> |
---|
152 | </filter-mapping> |
---|
153 | |
---|
154 | |
---|
155 | <!-- ======================================================= S E R V L E T S --> |
---|
156 | <servlet> |
---|
157 | <description> |
---|
158 | </description> |
---|
159 | <servlet-name>Dispatcher.Servlet</servlet-name> |
---|
160 | <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
---|
161 | <init-param> |
---|
162 | <param-name>contextConfigLocation</param-name> |
---|
163 | <param-value> |
---|
164 | /WEB-INF/config/spring/home.xml |
---|
165 | /WEB-INF/config/spring/publications.xml |
---|
166 | /WEB-INF/config/spring/indicator.xml |
---|
167 | /WEB-INF/config/spring/community.xml |
---|
168 | /WEB-INF/config/spring/query.xml |
---|
169 | /WEB-INF/config/spring/secure.xml |
---|
170 | /WEB-INF/config/spring/phom.xml |
---|
171 | /WEB-INF/config/spring/view.xml |
---|
172 | |
---|
173 | /WEB-INF/config/spring/query_definition.xml |
---|
174 | /WEB-INF/config/spring/user.xml |
---|
175 | |
---|
176 | /WEB-INF/config/spring/chart-agileblox.xml |
---|
177 | /WEB-INF/config/spring/publish-remote.xml |
---|
178 | |
---|
179 | /WEB-INF/config/spring/dispatcher_servlet.xml</param-value> |
---|
180 | </init-param> |
---|
181 | <load-on-startup>10</load-on-startup> |
---|
182 | </servlet> |
---|
183 | |
---|
184 | <servlet> |
---|
185 | <description> |
---|
186 | AWT based captcha servler that generates a simple random AWT |
---|
187 | generated text graphic (streams back) and puts the associated |
---|
188 | random text into the user's sesssion for validation. |
---|
189 | </description> |
---|
190 | <servlet-name>Captcha.Servlet</servlet-name> |
---|
191 | <servlet-class>org.ibisph.web.servlet.AWTCaptchaServlet</servlet-class> |
---|
192 | </servlet> |
---|
193 | |
---|
194 | |
---|
195 | |
---|
196 | <!-- ======================================= S E R V L E T M A P P I N G S --> |
---|
197 | <!-- Servlet and filter URL mappings have the same exact limitations as |
---|
198 | such they are handled in a similar manner - all requests are routed |
---|
199 | to the Spring request dispaatcher servlet which uses more robust URL |
---|
200 | to controller mappings. This is not very efficient for static content |
---|
201 | but static content has header values that encourage the browser to cache |
---|
202 | its content. |
---|
203 | |
---|
204 | setup the dispatcher servlet to handle all requsets with the defaul explicitly |
---|
205 | configed to handle all static content: |
---|
206 | <servlet-mapping> |
---|
207 | <servlet-name>default</servlet-name> |
---|
208 | <url-pattern>/css/*</url-pattern> |
---|
209 | <url-pattern>/image/*</url-pattern> |
---|
210 | <url-pattern>*.ico</url-pattern> |
---|
211 | <url-pattern>/js/*</url-pattern> |
---|
212 | <url-pattern>*.jsp</url-pattern> |
---|
213 | <url-pattern>*.log</url-pattern> |
---|
214 | <url-pattern>/xml/*</url-pattern> |
---|
215 | </servlet-mapping> |
---|
216 | |
---|
217 | <url-pattern>/*</url-pattern> |
---|
218 | |
---|
219 | the above has an issue with the path prefix needing to be stripped for |
---|
220 | the correct xml file path. Doing this would however do away with the |
---|
221 | ds needing to check full path and the below mappings which are basically |
---|
222 | used to strip url path prefixes. |
---|
223 | --> |
---|
224 | <servlet-mapping> |
---|
225 | <servlet-name>Dispatcher.Servlet</servlet-name> |
---|
226 | |
---|
227 | <url-pattern>/home/*</url-pattern> |
---|
228 | <url-pattern>/publications/*</url-pattern> |
---|
229 | <url-pattern>/indicator/*</url-pattern> |
---|
230 | <url-pattern>/community/*</url-pattern> |
---|
231 | <url-pattern>/query/*</url-pattern> |
---|
232 | <url-pattern>/user/*</url-pattern> |
---|
233 | <url-pattern>/secure/*</url-pattern> |
---|
234 | <url-pattern>/phom/*</url-pattern> |
---|
235 | |
---|
236 | <url-pattern>/view/*</url-pattern> |
---|
237 | <url-pattern>/edit/*</url-pattern> |
---|
238 | <url-pattern>/save/*</url-pattern> |
---|
239 | <url-pattern>/delete/*</url-pattern> |
---|
240 | <url-pattern>/run/*</url-pattern> |
---|
241 | <url-pattern>/apply/*</url-pattern> |
---|
242 | <url-pattern>/send/*</url-pattern> |
---|
243 | <url-pattern>/verify/*</url-pattern> |
---|
244 | |
---|
245 | <!-- |
---|
246 | Default publishing URL mapping that even if direct publishing is |
---|
247 | configured in the admin app does no harm as these URLs are never hit. |
---|
248 | --> |
---|
249 | <url-pattern>/publish/*</url-pattern> |
---|
250 | <url-pattern>/unpublish/*</url-pattern> |
---|
251 | </servlet-mapping> |
---|
252 | |
---|
253 | <!-- |
---|
254 | NOTE: These mappings are mainly used as a mechanism to remove a path prefix. |
---|
255 | For this to work, the request's getPathInfo() method is used, not the get |
---|
256 | URL method. Also, for Spring's dispatcher servlet to property resolve/ |
---|
257 | handle full paths the "alwaysUseFullPath" property must be set to "true". |
---|
258 | Example of usage is for ip charts it strips off the /indicator/graphic/ from |
---|
259 | the path so it's one less item to parse - exposing the chart name as the first |
---|
260 | item. This also makes it easier if at some point for the charting |
---|
261 | functionality to be moved to a seperate servlet. |
---|
262 | --> |
---|
263 | <servlet-mapping> |
---|
264 | <servlet-name>Dispatcher.Servlet</servlet-name> |
---|
265 | |
---|
266 | <url-pattern>/indicator/graphic/*</url-pattern> |
---|
267 | <url-pattern>/query/selection/*</url-pattern> |
---|
268 | <url-pattern>/query/configuration/*</url-pattern> |
---|
269 | <url-pattern>/query/builder/*</url-pattern> |
---|
270 | <url-pattern>/query/submit/*</url-pattern> |
---|
271 | <url-pattern>/query/result/*</url-pattern> |
---|
272 | <url-pattern>/query/result/graphic/*</url-pattern> |
---|
273 | |
---|
274 | <url-pattern>/secure/query/selection/*</url-pattern> |
---|
275 | <url-pattern>/secure/query/configuration/*</url-pattern> |
---|
276 | <url-pattern>/secure/query/builder/*</url-pattern> |
---|
277 | <url-pattern>/secure/query/submit/*</url-pattern> |
---|
278 | <url-pattern>/secure/query/result/*</url-pattern> |
---|
279 | <url-pattern>/secure/query/result/graphic/*</url-pattern> |
---|
280 | </servlet-mapping> |
---|
281 | |
---|
282 | <servlet-mapping> |
---|
283 | <servlet-name>Captcha.Servlet</servlet-name> |
---|
284 | <url-pattern>/captcha/*</url-pattern> |
---|
285 | </servlet-mapping> |
---|
286 | |
---|
287 | |
---|
288 | |
---|
289 | <!-- =================================================== J S P C O N F I G --> |
---|
290 | <jsp-config> |
---|
291 | <jsp-property-group> |
---|
292 | <description>Property group for common configuration for all the JSP's</description> |
---|
293 | <display-name>default</display-name> |
---|
294 | <url-pattern>*.jsp</url-pattern> |
---|
295 | <el-ignored>false</el-ignored> |
---|
296 | <page-encoding>ISO-8859-1</page-encoding> |
---|
297 | <scripting-invalid>false</scripting-invalid> |
---|
298 | <trim-directive-whitespaces>true</trim-directive-whitespaces> |
---|
299 | </jsp-property-group> |
---|
300 | </jsp-config> |
---|
301 | |
---|
302 | |
---|
303 | <!-- =========================================== S E S S I O N C O N F I G --> |
---|
304 | <session-config> |
---|
305 | <!-- Inactive timeout value for a user's session. Value is in minutes. --> |
---|
306 | <session-timeout>30</session-timeout> |
---|
307 | |
---|
308 | <!-- Servlet 3.0 value (Tomcat7) that makes it more difficult for browser scripting |
---|
309 | to steal the user's session id |
---|
310 | <cookie-config> |
---|
311 | <http-only>true</http-only> |
---|
312 | </cookie-config> |
---|
313 | --> |
---|
314 | </session-config> |
---|
315 | |
---|
316 | |
---|
317 | <!-- ============================================= M I M E M A P P I N G S --> |
---|
318 | <mime-mapping> |
---|
319 | <extension>htm</extension> |
---|
320 | <mime-type>text/html</mime-type> |
---|
321 | </mime-mapping> |
---|
322 | <mime-mapping> |
---|
323 | <extension>html</extension> |
---|
324 | <mime-type>text/html</mime-type> |
---|
325 | </mime-mapping> |
---|
326 | <mime-mapping> |
---|
327 | <extension>xml</extension> |
---|
328 | <mime-type>text/xml</mime-type> |
---|
329 | </mime-mapping> |
---|
330 | <mime-mapping> |
---|
331 | <extension>css</extension> |
---|
332 | <mime-type>text/css</mime-type> |
---|
333 | </mime-mapping> |
---|
334 | <mime-mapping> |
---|
335 | <extension>ico</extension> |
---|
336 | <mime-type>image/vnd.microsoft.icon</mime-type> |
---|
337 | </mime-mapping> |
---|
338 | <mime-mapping> |
---|
339 | <extension>js</extension> |
---|
340 | <mime-type>text/javascript</mime-type> |
---|
341 | </mime-mapping> |
---|
342 | <mime-mapping> |
---|
343 | <extension>jsp</extension> |
---|
344 | <mime-type>text/html</mime-type> |
---|
345 | </mime-mapping> |
---|
346 | <mime-mapping> |
---|
347 | <extension>log</extension> |
---|
348 | <mime-type>text/plain</mime-type> |
---|
349 | </mime-mapping> |
---|
350 | <mime-mapping> |
---|
351 | <extension>gif</extension> |
---|
352 | <mime-type>image/gif</mime-type> |
---|
353 | </mime-mapping> |
---|
354 | <mime-mapping> |
---|
355 | <extension>jpg</extension> |
---|
356 | <mime-type>image/jpeg</mime-type> |
---|
357 | </mime-mapping> |
---|
358 | <mime-mapping> |
---|
359 | <extension>jpeg</extension> |
---|
360 | <mime-type>image/jpeg</mime-type> |
---|
361 | </mime-mapping> |
---|
362 | <mime-mapping> |
---|
363 | <extension>png</extension> |
---|
364 | <mime-type>image/png</mime-type> |
---|
365 | </mime-mapping> |
---|
366 | <mime-mapping> |
---|
367 | <extension>tiff</extension> |
---|
368 | <mime-type>image/tiff</mime-type> |
---|
369 | </mime-mapping> |
---|
370 | <mime-mapping> |
---|
371 | <extension>tif</extension> |
---|
372 | <mime-type>image/tiff</mime-type> |
---|
373 | </mime-mapping> |
---|
374 | <mime-mapping> |
---|
375 | <extension>svg</extension> |
---|
376 | <mime-type>image/svg+xml</mime-type> |
---|
377 | </mime-mapping> |
---|
378 | <mime-mapping> |
---|
379 | <extension>svgz</extension> |
---|
380 | <mime-type>image/svg+xml</mime-type> |
---|
381 | </mime-mapping> |
---|
382 | |
---|
383 | <mime-mapping> |
---|
384 | <extension>pdf</extension> |
---|
385 | <mime-type>image/pdf</mime-type> |
---|
386 | </mime-mapping> |
---|
387 | |
---|
388 | <mime-mapping> |
---|
389 | <extension>xls</extension> |
---|
390 | <mime-type>application/vnd.ms-excel</mime-type> |
---|
391 | </mime-mapping> |
---|
392 | |
---|
393 | |
---|
394 | <!-- =============================== D E F A U L T / W E L C O M E P A G E --> |
---|
395 | <welcome-file-list> |
---|
396 | <welcome-file>home/Welcome.html</welcome-file> |
---|
397 | </welcome-file-list> |
---|
398 | |
---|
399 | |
---|
400 | <!-- ======================================= H T T P E R R O R P A G E S --> |
---|
401 | <error-page><error-code>401</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=You are not authorized to view the requested resource.</location></error-page> |
---|
402 | <error-page><error-code>403</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=You are trying to view a restricted resource. The request was understood by the server but a response was refused.</location></error-page> |
---|
403 | <error-page><error-code>404</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=Requested resource was not found. It has either moved or is unavailable.</location></error-page> |
---|
404 | <error-page><error-code>405</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The page tried to use a method which is not supported for this URL.</location></error-page> |
---|
405 | <error-page><error-code>406</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The requested resource exists, but not in a format/type that your browser will accept.</location></error-page> |
---|
406 | <error-page><error-code>407</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The proxy server needs authorization before it can proceed.</location></error-page> |
---|
407 | <error-page><error-code>408</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=Request timed out. The resource is in use or is temporarily unavailable or there is a network problem.</location></error-page> |
---|
408 | <error-page><error-code>414</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The requested URI (URL) is too long for the server to handle.</location></error-page> |
---|
409 | <error-page><error-code>415</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The server can not process the request because the request body is in an unsupported media format.</location></error-page> |
---|
410 | |
---|
411 | <error-page><error-code>500</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=An unexpected error occurred inside the server that prevented it from fulfilling the request.</location></error-page> |
---|
412 | <error-page><error-code>501</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=Requested function is not implemented by this application on this server.</location></error-page> |
---|
413 | <error-page><error-code>502</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=Bad internet gateway. A server acting as a gateway or proxy did not receive a valid response from an upstream server.</location></error-page> |
---|
414 | <error-page><error-code>503</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The service (server) is temporarily unavailable but should be restored in the future.</location></error-page> |
---|
415 | <error-page><error-code>504</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=A gateway timout error has occured. A server acting as a gateway or proxy did not receive a valid response in time.</location></error-page> |
---|
416 | <error-page><error-code>505</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The server does not support the version of the HTTP protocol used in the request.</location></error-page> |
---|
417 | |
---|
418 | <error-page><exception-type>java.lang.Throwable</exception-type><location>/WEB-INF/jsp/error/detail.jsp?message=Uncaught System Run Time Exception</location></error-page> |
---|
419 | </web-app> |
---|
420 | |
---|