<?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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
    <display-name>Project Name</display-name>

    <servlet>
        <!-- this servlet-name is part of the springapp-servlet.xml filename -->
        <servlet-name>springapp</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

        <init-param>
            <param-name>namespace</param-name>
            <param-value>project-springapp</param-value>
        </init-param>

        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>springapp</servlet-name>
        <url-pattern>*.json</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>springapp</servlet-name>
        <url-pattern>*.download</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>springapp</servlet-name>
        <url-pattern>*.upload</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <!--
      Loads the root application context of this web app at startup.
      The application context is then available via 
      WebApplicationContextUtils.getWebApplicationContext(ServletContext).
    -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <listener>
        <listener-class>com.activegrid.runtime.server.CleanupListener</listener-class>
    </listener>

    <!--
      Location of the XML file that defines the root application context.
      Applied by ContextLoaderListener.
    -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/project-springapp.xml</param-value>
    </context-param>

    <!--
        Filter requests into UTF-8.  This must be the first filter defined/run.
    -->
    <filter>
        <filter-name>springEncodingFilter</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-mapping>
        <filter-name>springEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- security configuration -->
    <filter>
        <filter-name>Acegi Ajax Filter</filter-name>
        <filter-class>com.activegrid.runtime.security.AcegiAjaxFilter</filter-class>
    </filter>

    <filter>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
        <init-param>
            <param-name>targetBean</param-name>
            <param-value>filterChainProxy</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>Acegi Ajax Filter</filter-name>
        <url-pattern>/j_acegi_security_check</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

