root/main/trunk/greenstone3/web/WEB-INF/web.xml @ 29687

Revision 29687, 8.1 KB (checked in by jts21, 5 years ago)

Split greenstone servlets into another file (servlets.xml) which is included in web.xml as an XML entity

  • Property svn:keywords set to Author Date Id Revision
Line 
1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2<!DOCTYPE web-xml [
3    <!ENTITY servlets-config SYSTEM "servlets.xml">
4]>
5<!-- this is based on a sample web.xml file provided by
6http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/web.xml.txt
7-->
8<web-app>
9    <display-name>GSDL3</display-name>
10    <description>
11        Greenstone digital library version 3.
12    </description>
13 
14    <filter>
15        <filter-name>Greenstone URL Filter</filter-name>
16        <filter-class>org.greenstone.gsdl3.core.URLFilter</filter-class>
17    </filter>
18
19    <filter-mapping>
20        <filter-name>Greenstone URL Filter</filter-name>
21        <url-pattern>*</url-pattern>
22    </filter-mapping>
23 
24    <!-- Context initialization parameters that define shared
25    String constants used within your application, which
26    can be customized by the system administrator who is
27    installing your application.  The values actually
28    assigned to these parameters can be retrieved in a
29    servlet or JSP page by calling:
30
31    String value =
32    getServletContext().getInitParameter("name");
33
34    where "name" matches the <param-name> element of
35    one of these initialization parameters.
36
37    You can define any number of context initialization
38    parameters, including zero.
39    -->
40 
41    <context-param>
42        <param-name>webmaster</param-name>
43        <param-value>greenstone3@list.scms.waikato.ac.nz</param-value>
44        <description>
45            The EMAIL address of the administrator to whom questions
46            and comments about this application should be addressed.
47        </description>
48    </context-param>
49 
50
51    <!-- Servlet definitions for the servlets that make up
52    your web application, including initialization
53    parameters.  With Tomcat, you can also send requests
54    to servlets not listed here with a request like this:
55
56    http://localhost:8080/{context-path}/servlet/{classname}
57
58    but this usage is not guaranteed to be portable.  It also
59    makes relative references to images and other resources
60    required by your servlet more complicated, so defining
61    all of your servlets (and defining a mapping to them with
62    a servlet-mapping element) is recommended.
63
64    Servlet initialization parameters can be retrieved in a
65    servlet or JSP page by calling:
66
67    String value =
68    getServletConfig().getInitParameter("name");
69
70    where "name" matches the <param-name> element of
71    one of these initialization parameters.
72
73    You can define any number of servlets, including zero.
74    -->
75
76    <servlet>
77        <servlet-name>tester</servlet-name>
78        <description>a test servlet</description>
79        <servlet-class>TestServlet</servlet-class>
80    </servlet>
81 
82    <!-- For client side text fetching -->
83    <servlet>
84        <servlet-name>grabtext</servlet-name>
85        <description>Grabs text for client-side display with minimal overhead.</description>
86        <servlet-class>org.greenstone.gsdl3.ClientSideServlet</servlet-class>
87    </servlet>
88 
89    <!-- See servlets.xml -->
90    &servlets-config;
91
92    <!-- axis servlets -->
93    <servlet>
94        <servlet-name>AxisServlet</servlet-name>
95        <display-name>Apache-Axis Servlet</display-name>
96        <servlet-class>
97            org.apache.axis.transport.http.AxisServlet
98        </servlet-class>
99    </servlet>
100
101    <servlet>
102        <servlet-name>AdminServlet</servlet-name>
103        <display-name>Axis Admin Servlet</display-name>
104        <servlet-class>
105            org.apache.axis.transport.http.AdminServlet
106        </servlet-class>
107        <load-on-startup>100</load-on-startup>
108    </servlet>
109
110    <servlet>
111        <servlet-name>SOAPMonitorService</servlet-name>
112        <display-name>SOAPMonitorService</display-name>
113        <servlet-class>
114            org.apache.axis.monitor.SOAPMonitorService
115        </servlet-class>
116        <init-param>
117            <param-name>SOAPMonitorPort</param-name>
118            <param-value>5001</param-value>
119        </init-param>
120        <load-on-startup>100</load-on-startup>
121    </servlet>
122   
123    <servlet>
124        <servlet-name>oaiserver</servlet-name>
125        <description>an oai servlet</description>
126        <servlet-class>org.greenstone.gsdl3.OAIServer</servlet-class>
127        <init-param>
128            <param-name>default_lang</param-name>
129            <param-value>en</param-value>
130        </init-param>
131        <init-param>
132            <param-name>site_name</param-name>
133            <!-- More than one site name can be specified using the comma separation style: localsite1,localsite2 -->
134            <param-value>localsite</param-value>
135        </init-param>
136    </servlet>
137   
138    <servlet>
139        <servlet-name>mat</servlet-name>
140        <description>Metadata Analysis Tool</description>
141        <servlet-class>org.greenstone.mat.servlet.MatServlet</servlet-class>
142    </servlet>
143
144
145
146
147 
148    <!-- Define mappings that are used by the servlet container to
149         translate a particular request URI (context-relative) to a
150         particular servlet.  The examples below correspond to the
151         servlet descriptions above.  Thus, a request URI like:
152
153           http://localhost:8080/{contextpath}/graph
154
155         will be mapped to the "graph" servlet, while a request like:
156
157           http://localhost:8080/{contextpath}/saveCustomer.do
158
159         will be mapped to the "controller" servlet.
160
161         You may define any number of servlet mappings, including zero.
162         It is also legal to define more than one mapping for the same
163         servlet, if you wish to.
164    -->
165    <!--
166   
167    <servlet-mapping>
168      <servlet-name>controller</servlet-name>
169      <url-pattern>*.do</url-pattern>
170    </servlet-mapping>
171
172    <servlet-mapping>
173      <servlet-name>graph</servlet-name>
174      <url-pattern>/graph</url-pattern>
175    </servlet-mapping>
176    -->
177   
178
179<!--There is no need for this mapping, I think -->
180    <servlet-mapping>
181        <servlet-name>oaiserver</servlet-name>
182        <url-pattern>/oaiserver</url-pattern>
183    </servlet-mapping>
184
185    <servlet-mapping>
186        <servlet-name>tester</servlet-name>
187        <url-pattern>/testing</url-pattern>
188    </servlet-mapping>
189 
190    <servlet-mapping>
191        <servlet-name>grabtext</servlet-name>
192        <url-pattern>/grabtext</url-pattern>
193    </servlet-mapping>
194 
195    <!-- axis mappings -->
196    <servlet-mapping>
197        <servlet-name>AxisServlet</servlet-name>
198        <url-pattern>/servlet/AxisServlet</url-pattern>
199    </servlet-mapping>
200
201    <servlet-mapping>
202        <servlet-name>AxisServlet</servlet-name>
203        <url-pattern>*.jws</url-pattern>
204    </servlet-mapping>
205
206    <servlet-mapping>
207        <servlet-name>AxisServlet</servlet-name>
208        <url-pattern>/services/*</url-pattern>
209    </servlet-mapping>
210   
211    <servlet-mapping>
212        <servlet-name>mat</servlet-name>
213        <url-pattern>/mat</url-pattern>
214    </servlet-mapping>
215
216
217  <!-- uncomment this if you want to use the SOAPMonitorService. You will also
218  need to copy the SOAPMonitorApplet*.class files from
219  gsdl3/comms/soap/axis/web/WEB-INF/classes to the gsdl3/web directory. See the
220  comms/soap/axis/docs/install.html Appendix for details about how to use this -->
221  <!--
222  <servlet-mapping>
223    <servlet-name>SOAPMonitorService</servlet-name>
224    <url-pattern>/SOAPMonitor</url-pattern>
225  </servlet-mapping>
226  -->
227  <!-- uncomment this if you want the admin servlet -->
228  <!--
229  <servlet-mapping>
230    <servlet-name>AdminServlet</servlet-name>
231    <url-pattern>/servlet/AdminServlet</url-pattern>
232  </servlet-mapping>
233  -->
234
235  <!-- Define the default session timeout for your application,
236  in minutes.  From a servlet or JSP page, you can modify
237  the timeout for a particular session dynamically by using
238  HttpSession.getMaxInactiveInterval(). -->
239
240  <session-config>
241    <session-timeout>240</session-timeout>    <!-- 4 hours -->
242  </session-config>
243
244  <!-- axis mime-mappings -->
245  <mime-mapping>
246    <extension>wsdl</extension>
247    <mime-type>text/xml</mime-type>
248  </mime-mapping>
249 
250  <mime-mapping>
251    <extension>xsd</extension>
252    <mime-type>text/xml</mime-type>
253  </mime-mapping>
254
255<!-- Deny access to contents of URL pattern /logs/*, although greenstone.log is the important one. It appears the url pattern has to be relative to the web directory.
256http://stackoverflow.com/questions/5333266/tomcat-deny-access-to-specific-files
257and http://www.coderanch.com/t/84442/Tomcat/write-correct-url-pattern-security -->
258  <security-constraint>
259    <web-resource-collection>
260        <web-resource-name>log files</web-resource-name>
261        <description>No direct access to greenstone's logs.</description>
262        <url-pattern>/logs/*</url-pattern>
263        <http-method>POST</http-method>
264        <http-method>GET</http-method>
265    </web-resource-collection>
266    <auth-constraint>
267        <description>No direct browser access to log files.</description>
268        <role-name>NobodyHasThisRole</role-name>
269    </auth-constraint>
270  </security-constraint>
271
272</web-app>
Note: See TracBrowser for help on using the browser.