source: gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy/src/main/webapp/WEB-INF/web.xml@ 35387

Last change on this file since 35387 was 35387, checked in by davidb, 3 years ago

Add CORS filter to allow requests from localhost:8080

File size: 4.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<web-app xmlns="http://java.sun.com/xml/ns/javaee"
4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
6 http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
7 version="3.0">
8
9 <!-- General description of your web application -->
10 <display-name>Korero Maori TTS ASR API Proxy</display-name>
11 <description>
12 A servlet that hosts a proxy for the speech-to-text ASR API of https://koreromaori.io/
13 </description>
14
15 <!-- Context initialization parameters that define shared
16 String constants used within your application, which
17 can be customized by the system administrator who is
18 installing your application. The values actually
19 assigned to these parameters can be retrieved in a
20 servlet or JSP page by calling:
21
22 String value =
23 getServletContext().getInitParameter("name");
24
25 where "name" matches the <param-name> element of
26 one of these initialization parameters.
27
28 You can define any number of context initialization
29 parameters, including zero.
30 -->
31
32 <filter>
33 <filter-name>CorsFilter</filter-name>
34 <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
35 <init-param>
36 <param-name>cors.allowed.origins</param-name>
37 <param-value>http://localhost:8080</param-value> <!-- Separate values by a comma -->
38 </init-param>
39 </filter>
40
41 <!-- Servlet definitions for the servlets that make up
42 your web application, including initialization
43 parameters. With Tomcat, you can also send requests
44 to servlets not listed here with a request like this:
45
46 http://localhost:8080/{context-path}/servlet/{classname}
47
48 but this usage is not guaranteed to be portable. It also
49 makes relative references to images and other resources
50 required by your servlet more complicated, so defining
51 all of your servlets (and defining a mapping to them with
52 a servlet-mapping element) is recommended.
53
54 Servlet initialization parameters can be retrieved in a
55 servlet or JSP page by calling:
56
57 String value =
58 getServletConfig().getInitParameter("name");
59
60 where "name" matches the <param-name> element of
61 one of these initialization parameters.
62
63 You can define any number of servlets, including zero.
64 -->
65
66 <servlet>
67 <servlet-name>koreroMaoriTranscribe</servlet-name>
68 <servlet-class>org.atea.nlptools.koreromaoriproxy.TranscriptionServlet</servlet-class>
69 <load-on-startup>0</load-on-startup>
70 </servlet>
71
72 <servlet>
73 <servlet-name>koreroMaoriTranscribeTest</servlet-name>
74 <servlet-class>org.atea.nlptools.koreromaoriproxy.TestServlet</servlet-class>
75 </servlet>
76
77 <!-- Define mappings that are used by the servlet container to
78 translate a particular request URI (context-relative) to a
79 particular servlet. The examples below correspond to the
80 servlet descriptions above. Thus, a request URI like:
81
82 http://localhost:8080/{contextpath}/graph
83
84 will be mapped to the "graph" servlet, while a request like:
85
86 http://localhost:8080/{contextpath}/saveCustomer.do
87
88 will be mapped to the "controller" servlet.
89
90 You may define any number of servlet mappings, including zero.
91 It is also legal to define more than one mapping for the same
92 servlet, if you wish to.
93 -->
94
95 <filter-mapping>
96 <filter-name>CorsFilter</filter-name>
97 <url-pattern>/*</url-pattern>
98 </filter-mapping>
99
100 <servlet-mapping>
101 <servlet-name>koreroMaoriTranscribeTest</servlet-name>
102 <url-pattern>/transcribe/test</url-pattern>
103 </servlet-mapping>
104
105 <servlet-mapping>
106 <servlet-name>koreroMaoriTranscribe</servlet-name>
107 <url-pattern>/transcribe</url-pattern>
108 </servlet-mapping>
109
110 <!-- Define the default session timeout for your application,
111 in minutes. From a servlet or JSP page, you can modify
112 the timeout for a particular session dynamically by using
113 HttpSession.getMaxInactiveInterval(). -->
114
115 <session-config>
116 <session-timeout>30</session-timeout> <!-- 30 minutes -->
117 </session-config>
118
119 <welcome-file-list>
120 <welcome-file>unauthorised.html</welcome-file>
121 </welcome-file-list>
122</web-app>
Note: See TracBrowser for help on using the repository browser.