<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

	<display-name>Tudu</display-name>

	<!-- Define the basename for a resource bundle for I18N -->
	<context-param>
		<param-name>
			javax.servlet.jsp.jstl.fmt.localizationContext
		</param-name>
		<param-value>messages</param-value>
	</context-param>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/applicationContext*.xml;classpath:org/codehaus/xfire/spring/xfire.xml</param-value>
	</context-param>

	<filter>
		<filter-name>Spring character encoding filter</filter-name>
		<filter-class>
			org.springframework.web.filter.CharacterEncodingFilter
		</filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>

	<filter>
		<filter-name>Jamon Monitoring Filter</filter-name>
		<filter-class>
			tudu.web.filter.JAMonFilter
		</filter-class>
	</filter>

    <filter>
        <filter-name>Acegi Security Filter</filter-name>
        <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
        <init-param>
            <param-name>targetClass</param-name>
            <param-value>org.acegisecurity.util.FilterChainProxy</param-value>
        </init-param>
    </filter>
    
	<filter>
		<filter-name>Hibernate Session In View Filter</filter-name>
		<filter-class>
			org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
		</filter-class>
	</filter>

	<!-- Filter mappings -->
	<filter-mapping>
		<filter-name>Spring character encoding filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
	<filter-mapping>
		<filter-name>Jamon Monitoring Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
	<filter-mapping>
		<filter-name>Hibernate Session In View Filter</filter-name>
		<url-pattern>*.action</url-pattern>
	</filter-mapping>
	
	<filter-mapping>
		<filter-name>Hibernate Session In View Filter</filter-name>
		<url-pattern>/secure/dwr/*</url-pattern>
	</filter-mapping>
	
	<filter-mapping>
		<filter-name>Hibernate Session In View Filter</filter-name>
		<url-pattern>/j_acegi_security_check</url-pattern>
	</filter-mapping>

	<!-- Acegi Security filters mappings -->
	<filter-mapping>
		<filter-name>Acegi Security Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
	<listener>
		<listener-class>
			org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>

	<servlet>
		<servlet-name>action</servlet-name>
		<servlet-class>
			org.apache.struts.action.ActionServlet
		</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet>
		<servlet-name>dwr-invoker</servlet-name>
		<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
		<init-param>
			<param-name>debug</param-name>
			<param-value>false</param-value>
		</init-param>
	</servlet>
	
	<servlet>
		<servlet-name>xfire</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
	</servlet>
	
	<servlet>
		<servlet-name>axis</servlet-name>
		<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
		<load-on-startup>10</load-on-startup>
	</servlet>

	<servlet>
		<servlet-name>rss-feed</servlet-name>
		<servlet-class>tudu.web.servlet.RssFeedServlet</servlet-class>
	</servlet>
	
	<servlet>
		<servlet-name>backup</servlet-name>
		<servlet-class>tudu.web.servlet.BackupServlet</servlet-class>
	</servlet>
	
	<servlet>
		<servlet-name>dump-database</servlet-name>
		<servlet-class>tudu.web.servlet.DumpDatabaseServlet</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>action</servlet-name>
		<url-pattern>*.action</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>dwr-invoker</servlet-name>
		<url-pattern>/secure/dwr/*</url-pattern>
	</servlet-mapping>
	
	<servlet-mapping>
		<servlet-name>xfire</servlet-name>
		<url-pattern>/ws/xfire/*</url-pattern>
	</servlet-mapping>
	
	<servlet-mapping>
		<servlet-name>axis</servlet-name>
		<url-pattern>/ws/axis/*</url-pattern>
	</servlet-mapping>
	
	<servlet-mapping>
		<servlet-name>rss-feed</servlet-name>
		<url-pattern>/WEB-INF/servlet/RssFeedServlet</url-pattern>
	</servlet-mapping>
	
	<servlet-mapping>
		<servlet-name>backup</servlet-name>
		<url-pattern>/secure/servlet/tudu_lists_backup.xml</url-pattern>
	</servlet-mapping>
	
	<servlet-mapping>
		<servlet-name>dump-database</servlet-name>
		<url-pattern>/secure/servlet/database_dump.xml</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>

	<error-page>
		<error-code>500</error-code>
		<location>/WEB-INF/jsp/error.jsp</location>
	</error-page>
	
	<error-page>
		<error-code>404</error-code>
		<location>/WEB-INF/jsp/error.jsp</location>
	</error-page>

	<resource-ref>
		<description>Database Connection</description>
		<res-ref-name>jdbc/tudu</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
		<res-sharing-scope>Shareable</res-sharing-scope>
	</resource-ref>
</web-app>
