use req.getContextPath to find the RootUri.. much more robust. 4.0 and 4.1 compatible...
[mir.git] / etc / web.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2
3 <!DOCTYPE web-app
4   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
5   "http://java.sun.com/dtd/web-app_2_3.dtd">
6
7 <web-app>
8     <servlet>
9         <servlet-name>
10             Mir
11         </servlet-name>
12         <servlet-class>
13             Mir
14         </servlet-class>
15
16         <init-param>
17             <param-name>Config</param-name>
18             <param-value>config</param-value>
19         </init-param>
20
21     </servlet>
22
23     <servlet>
24         <servlet-name>
25             OpenMir
26         </servlet-name>
27         <servlet-class>
28             OpenMir
29         </servlet-class>
30
31         <init-param>
32             <param-name>Config</param-name>
33             <param-value>config</param-value>
34         </init-param>
35
36     </servlet>
37     
38     <servlet-mapping>
39         <servlet-name>
40             Mir
41         </servlet-name>
42         <url-pattern>
43             /Mir
44         </url-pattern>
45     </servlet-mapping>
46
47     <servlet-mapping>
48         <servlet-name>
49             Mir
50         </servlet-name>
51         <url-pattern>
52             /servlet/Mir
53         </url-pattern>
54     </servlet-mapping>
55
56     <servlet-mapping>
57         <servlet-name>OpenMir</servlet-name>
58         <url-pattern>/OpenMir</url-pattern>
59     </servlet-mapping>
60
61     <servlet-mapping>
62         <servlet-name>OpenMir</servlet-name>
63         <url-pattern>/servlet/OpenMir</url-pattern>
64     </servlet-mapping>
65
66     <mime-mapping>
67       <extension>
68         mp3 
69       </extension>
70       <mime-type>
71         audio/x-mp3
72       </mime-type>
73     </mime-mapping>
74     <mime-mapping>
75       <extension>
76         ra
77       </extension>
78       <mime-type>
79         audio/vnd.rn-realaudio
80       </mime-type>
81     </mime-mapping>
82     <mime-mapping>
83       <extension>
84         rm
85       </extension>
86       <mime-type>
87         application/vnd.rn-realmedia
88       </mime-type>
89     </mime-mapping>
90     <mime-mapping>
91       <extension>
92         mov
93       </extension>
94       <mime-type>
95         video/quicktime 
96       </mime-type>
97     </mime-mapping>
98     <mime-mapping>
99       <extension>
100         mpg
101       </extension>
102       <mime-type>
103         video/mpeg
104       </mime-type>
105     </mime-mapping>
106     <mime-mapping>
107       <extension>
108         avi
109       </extension>
110       <mime-type>
111         video/x-msvideo
112       </mime-type>
113     </mime-mapping>
114     <mime-mapping>
115       <extension>
116         asf
117       </extension>
118       <mime-type>
119         video/x-ms-asf
120       </mime-type>
121     </mime-mapping>
122     <mime-mapping>
123       <extension>
124         pdf
125       </extension>
126       <mime-type>
127         application/pdf
128       </mime-type>
129     </mime-mapping>
130
131     <resource-ref>
132
133       <description>
134         Resource reference to a factory for java.sql.Connection instances that
135         may be used for talking to a particular database that is configured in
136         the server.xml file.
137       </description>
138
139       <res-ref-name>
140         jdbc/Mir
141       </res-ref-name>
142
143       <res-type>
144         javax.sql.DataSource
145       </res-type>
146
147       <res-auth>
148         Container
149       </res-auth>
150
151     </resource-ref>
152
153     <security-constraint>
154       <web-resource-collection>
155          <web-resource-name>Protected Area</web-resource-name>
156          <!-- Define the context-relative URL(s) to be protected -->
157          <url-pattern>/jsp/security/protected/*</url-pattern>
158          <!-- If you list http methods, only those methods are protected -->
159          <http-method>DELETE</http-method>
160          <http-method>GET</http-method>
161          <http-method>POST</http-method>
162          <http-method>PUT</http-method>
163       </web-resource-collection>
164       <auth-constraint>
165          <!-- Anyone with one of the listed roles may access this area -->
166          <role-name>tomcat</role-name>
167          <role-name>role1</role-name>
168       </auth-constraint>
169     </security-constraint>
170
171     <!-- Default login configuration uses BASIC authentication -->
172     <!--
173     <login-config>
174       <auth-method>BASIC</auth-method>
175       <realm-name>Example Basic Authentication Area</realm-name>
176     </login-config>
177     -->
178
179     <!-- Form-based login is enabled by default.  If you wish to
180          try Basic authentication, comment out the <login-config>
181          section below and uncomment the one above. -->
182     <login-config>
183       <auth-method>FORM</auth-method>
184       <realm-name>Example Form-Based Authentication Area</realm-name>
185       <form-login-config>
186         <form-login-page>/jsp/security/login/login.jsp</form-login-page>
187         <form-error-page>/jsp/security/login/error.jsp</form-error-page>
188       </form-login-config>
189     </login-config>
190
191 </web-app>