Working upload of photos (individual and zip)
[photos] / src / main / webapp / WEB-INF / web.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
3          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
5          version="3.0">
6
7     <display-name>cdi</display-name>
8
9     <!--
10           There are three means to configure Wickets configuration mode and they are
11           tested in the order given.
12           1) A system property: -Dwicket.configuration
13           2) servlet specific <init-param>
14           3) context specific <context-param>
15           The value might be either "development" (reloading when templates change)
16           or "deployment". If no configuration is found, "development" is the default.
17     -->
18
19     <!-- The image sender servlet has the sole task of sending
20                 images to the client, either a thumbnail or full image -->
21     <servlet>
22         <description>Servlet which sends the raw images.</description>
23         <display-name>ImageSender</display-name>
24         <servlet-name>ImageSender</servlet-name>
25         <servlet-class>org.wamblee.photos.servlet.ImageSender</servlet-class>
26         <load-on-startup>1</load-on-startup>
27     </servlet>
28     <servlet-mapping>
29         <servlet-name>ImageSender</servlet-name>
30         <url-pattern>/image/*</url-pattern>
31     </servlet-mapping>
32
33
34     <filter>
35         <filter-name>authentication</filter-name>
36         <filter-class>org.wamblee.photos.security.AuthenticationFilter</filter-class>
37         <init-param>
38             <param-name>loginpage</param-name>
39             <param-value>/login.jsp</param-value>
40         </init-param>
41         <!-- each authenticated user is assigned to the gruop ALL in the security realm configuration -->
42         <init-param>
43             <param-name>role</param-name>
44             <param-value>ALL</param-value>
45         </init-param>
46         <!-- defines the resource URLs for which no authentication is required -->
47         <init-param>
48             <param-name>resources</param-name>
49             <param-value>/resources</param-value>
50         </init-param>
51     </filter>
52
53     <filter>
54         <filter-name>photos</filter-name>
55         <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
56         <init-param>
57             <param-name>applicationClassName</param-name>
58             <param-value>org.wamblee.photos.wicket.WicketApplication</param-value>
59         </init-param>
60         <init-param>
61             <param-name>configuration</param-name>
62             <param-value>development</param-value>
63         </init-param>
64     </filter>
65
66     <filter-mapping>
67         <filter-name>authentication</filter-name>
68         <url-pattern>/*</url-pattern>
69     </filter-mapping>
70     <filter-mapping>
71         <filter-name>photos</filter-name>
72         <url-pattern>/*</url-pattern>
73     </filter-mapping>
74
75     <security-constraint>
76         <web-resource-collection>
77             <web-resource-name>resources</web-resource-name>
78             <url-pattern>/resources/*</url-pattern>
79         </web-resource-collection>
80     </security-constraint>
81     <security-constraint>
82         <web-resource-collection>
83             <web-resource-name>securedaccess</web-resource-name>
84             <url-pattern>/*</url-pattern>
85         </web-resource-collection>
86         <auth-constraint>
87             <role-name>ALL</role-name>
88             <role-name>users</role-name>
89         </auth-constraint>
90     </security-constraint>
91
92     <login-config>
93         <auth-method>FORM</auth-method>
94         <realm-name>PhotoXChangeRealm</realm-name>
95         <form-login-config>
96             <form-login-page>/login.jsp</form-login-page>
97             <form-error-page>/loginError.jsp</form-error-page>
98         </form-login-config>
99     </login-config>
100
101     <error-page>
102         <error-code>404</error-code>
103         <!-- view will redirect to login if the user is not logged in -->
104         <location>/404.jsp</location>
105     </error-page>
106
107     <session-config>
108         <session-timeout>10</session-timeout>
109     </session-config>
110
111     <welcome-file-list>
112         <welcome-file>login.jsp</welcome-file>
113     </welcome-file-list>
114
115     <security-role>
116         <role-name>ALL</role-name>
117     </security-role>
118
119 </web-app>