source: main/branches/2.1/src/main/webapps/ibisph-view/WEB-INF/web.xml @ 3663

Last change on this file since 3663 was 3663, checked in by Garth Braithwaite, 10 years ago

java and view webapp - commit that has most of model map. committing before ripping out some code and cleaning up more model maps.

File size: 16.8 KB
Line 
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
185        <!-- ======================================= S E R V L E T   M A P P I N G S -->
186        <!-- Servlet and filter URL mappings have the same exact limitations as
187                such they are handled in a similar manner - all requests are routed
188                to the Spring request dispaatcher servlet which uses more robust URL
189                to controller mappings.  This is not very efficient for static content
190                but static content has header values that encourage the browser to cache
191                its content. 
192
193                setup the dispatcher servlet to handle all requsets with the defaul explicitly
194                configed to handle all static content:
195        <servlet-mapping>
196                <servlet-name>default</servlet-name>
197                <url-pattern>/css/*</url-pattern>
198                <url-pattern>/image/*</url-pattern>
199                <url-pattern>*.ico</url-pattern>
200                <url-pattern>/js/*</url-pattern>
201                <url-pattern>*.jsp</url-pattern>
202                <url-pattern>/xml/*</url-pattern>
203        </servlet-mapping>   
204
205                <url-pattern>/*</url-pattern>
206
207                the above has an issue with the path prefix needing to be stripped for
208                the correct xml file path.  Doing this would however do away with the
209                ds needing to check full path and the below mappings which are basically
210                used to strip url path prefixes.
211        -->
212        <servlet-mapping>
213                <servlet-name>Dispatcher.Servlet</servlet-name>
214
215                <url-pattern>/home/*</url-pattern>
216                <url-pattern>/publications/*</url-pattern>
217                <url-pattern>/indicator/*</url-pattern>
218                <url-pattern>/community/*</url-pattern>
219                <url-pattern>/query/*</url-pattern>
220                <url-pattern>/user/*</url-pattern>
221                <url-pattern>/secure/*</url-pattern>
222                <url-pattern>/phom/*</url-pattern>
223
224                <url-pattern>/view/*</url-pattern>
225                <url-pattern>/edit/*</url-pattern>
226                <url-pattern>/save/*</url-pattern>
227                <url-pattern>/delete/*</url-pattern>
228                <url-pattern>/run/*</url-pattern>
229                <url-pattern>/apply/*</url-pattern>
230                <url-pattern>/send/*</url-pattern>
231
232                <!--
233                        Default publishing URL mapping that even if direct publishing is
234                        configured in the admin app does no harm as these URLs are never hit.
235                -->
236                <url-pattern>/publish/*</url-pattern>
237                <url-pattern>/unpublish/*</url-pattern>
238        </servlet-mapping>
239
240        <!--
241                NOTE: These mappings are mainly used as a mechanism to remove a path prefix.
242                For this to work, the request's getPathInfo() method is used, not the get
243                URL method.  Also, for Spring's dispatcher servlet to property resolve/
244                handle full paths the "alwaysUseFullPath" property must be set to "true".
245                Example of usage is for ip charts it strips off the /indicator/graphic/ from
246                the path so it's one less item to parse - exposing the chart name as the first
247                item.  This also makes it easier if at some point for the charting
248                functionality to be moved to a seperate servlet.
249        -->
250        <servlet-mapping>
251                <servlet-name>Dispatcher.Servlet</servlet-name> 
252
253                <url-pattern>/indicator/graphic/*</url-pattern> 
254                <url-pattern>/query/selection/*</url-pattern> 
255                <url-pattern>/query/configuration/*</url-pattern> 
256                <url-pattern>/query/builder/*</url-pattern> 
257                <url-pattern>/query/submit/*</url-pattern> 
258                <url-pattern>/query/result/*</url-pattern> 
259                <url-pattern>/query/result/graphic/*</url-pattern> 
260
261                <url-pattern>/secure/query/selection/*</url-pattern> 
262                <url-pattern>/secure/query/configuration/*</url-pattern> 
263                <url-pattern>/secure/query/builder/*</url-pattern> 
264                <url-pattern>/secure/query/submit/*</url-pattern> 
265                <url-pattern>/secure/query/result/*</url-pattern> 
266                <url-pattern>/secure/query/result/graphic/*</url-pattern> 
267        </servlet-mapping>
268
269
270
271        <!-- =================================================== J S P   C O N F I G -->
272        <jsp-config>
273                <jsp-property-group>
274                        <description>Property group for common configuration for all the JSP's</description>
275                        <display-name>default</display-name>
276                        <url-pattern>*.jsp</url-pattern>
277                        <el-ignored>false</el-ignored>
278                        <page-encoding>ISO-8859-1</page-encoding>
279                        <scripting-invalid>false</scripting-invalid>
280                        <trim-directive-whitespaces>true</trim-directive-whitespaces>
281                </jsp-property-group>
282        </jsp-config>
283
284
285        <!-- =========================================== S E S S I O N   C O N F I G -->
286        <session-config>
287                <!-- Inactive timeout value for a user's session.  Value is in minutes. -->
288                <session-timeout>30</session-timeout>
289
290                <!-- Servlet 3.0 value (Tomcat7) that makes it more difficult for browser scripting
291                to steal the user's session id
292                <cookie-config>
293                        <http-only>true</http-only>
294                </cookie-config>
295                -->
296        </session-config>
297
298
299        <!-- ============================================= M I M E   M A P P I N G S -->
300        <mime-mapping>
301                <extension>htm</extension>
302                <mime-type>text/html</mime-type>
303        </mime-mapping>
304        <mime-mapping>
305                <extension>html</extension>
306                <mime-type>text/html</mime-type>
307        </mime-mapping>
308        <mime-mapping>
309                <extension>xml</extension>
310                <mime-type>text/xml</mime-type>
311        </mime-mapping>
312        <mime-mapping>
313                <extension>css</extension>
314                <mime-type>text/css</mime-type>
315        </mime-mapping>
316        <mime-mapping>
317                <extension>ico</extension>
318                <mime-type>image/vnd.microsoft.icon</mime-type>
319        </mime-mapping>
320        <mime-mapping>
321                <extension>js</extension>
322                <mime-type>text/javascript</mime-type>
323        </mime-mapping>
324        <mime-mapping>
325                <extension>jsp</extension>
326                <mime-type>text/html</mime-type>
327        </mime-mapping>
328        <mime-mapping>
329                <extension>log</extension>
330                <mime-type>text/plain</mime-type>
331        </mime-mapping>
332        <mime-mapping>
333                <extension>gif</extension>
334                <mime-type>image/gif</mime-type>
335        </mime-mapping>
336        <mime-mapping>
337                <extension>jpg</extension>
338                <mime-type>image/jpeg</mime-type>
339        </mime-mapping>
340        <mime-mapping>
341                <extension>jpeg</extension>
342                <mime-type>image/jpeg</mime-type>
343        </mime-mapping>
344        <mime-mapping>
345                <extension>png</extension>
346                <mime-type>image/png</mime-type>
347        </mime-mapping>
348        <mime-mapping>
349                <extension>tiff</extension>
350                <mime-type>image/tiff</mime-type>
351        </mime-mapping>
352        <mime-mapping>
353                <extension>tif</extension>
354                <mime-type>image/tiff</mime-type>
355        </mime-mapping>
356        <mime-mapping>
357                <extension>svg</extension>
358                <mime-type>image/svg+xml</mime-type>
359        </mime-mapping>
360        <mime-mapping>
361                <extension>svgz</extension>
362                <mime-type>image/svg+xml</mime-type>
363        </mime-mapping>
364
365        <mime-mapping>
366                <extension>pdf</extension>
367                <mime-type>image/pdf</mime-type>
368        </mime-mapping>
369
370        <mime-mapping>
371                <extension>xls</extension>
372                <mime-type>application/vnd.ms-excel</mime-type>
373        </mime-mapping>
374
375               
376        <!-- =============================== D E F A U L T / W E L C O M E   P A G E -->
377        <welcome-file-list>
378                <welcome-file>home/Welcome.html</welcome-file>
379        </welcome-file-list>
380
381
382        <!-- ======================================= H T T P   E R R O R   P A G E S -->
383        <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>
384        <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>
385        <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>
386        <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>
387        <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>
388        <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>
389        <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>
390        <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>
391        <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>
392
393        <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>
394        <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>
395        <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>
396        <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>
397        <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>
398        <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>
399
400        <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>
401</web-app>
402
Note: See TracBrowser for help on using the repository browser.