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

  <display-name>unitedfront2</display-name>

  <context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>unitedfront2</param-value>
  </context-param>
  <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>file:/etc/unitedfront2/log4j.xml</param-value>
  </context-param>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/classes/applicationContext.xml
        /WEB-INF/classes/applicationContext-dao.xml
        /WEB-INF/classes/applicationContext-domain.xml
        /WEB-INF/applicationContext-security.xml
    </param-value>
  </context-param>

  <filter>
    <filter-name>WelcomeFileFilter</filter-name>
    <filter-class>org.unitedfront2.web.WelcomeFileFilter</filter-class>
  </filter>
  <filter>
    <filter-name>CharacterEncodingFilter</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>
  </filter>
  <filter>
    <filter-name>filterChainProxy</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  </filter>
  <filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
    <init-param>
      <param-name>statusEnabled</param-name>
      <param-value>false</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>WelcomeFileFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CharacterEncodingFilter</filter-name>
    <url-pattern>*.html</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>filterChainProxy</filter-name>
    <url-pattern>*.html</url-pattern>
    <url-pattern>*.xml</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>*.html</url-pattern>
    <url-pattern>*.xml</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.unitedfront2.web.ApplicationInstallListener</listener-class>
  </listener>

  <servlet>
    <servlet-name>servlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>namespace</param-name>
      <param-value>applicationContext-servlet</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>captcha</servlet-name>
    <servlet-class>org.unitedfront2.web.controller.ImageCaptchaServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>servlet</servlet-name>
    <url-pattern>*.html</url-pattern>
    <url-pattern>*.xml</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>captcha</servlet-name>
    <url-pattern>/captcha.jpeg</url-pattern>
  </servlet-mapping>

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

  <jsp-config>
    <taglib>
      <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
      <taglib-location>/WEB-INF/tld/standard/c.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>http://www.springframework.org/tags</taglib-uri>
      <taglib-location>/WEB-INF/tld/spring/spring.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
      <taglib-location>/WEB-INF/tld/spring/spring-form.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>http://www.springframework.org/security/tags</taglib-uri> 
      <taglib-location>/WEB-INF/tld/spring/security.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>http://tiles.apache.org/tags-tiles</taglib-uri>
      <taglib-location>/WEB-INF/tld/tiles/tiles-jsp.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>http://www.unitedfront2.org/tags</taglib-uri>
      <taglib-location>/WEB-INF/tld/uf2/uf2.tld</taglib-location>
    </taglib>
  </jsp-config>

  <error-page>
    <error-code>400</error-code>
    <location>/error/badRequest.html</location>
  </error-page>
  <error-page>
    <error-code>403</error-code>
    <location>/error/accessDenied.html</location>
  </error-page>
  <error-page>
    <error-code>404</error-code>
    <location>/error/notFound.html</location>
  </error-page>
  <error-page>
    <error-code>500</error-code>
    <location>/error/error.html</location>
  </error-page>

  <locale-encoding-mapping-list>
    <locale-encoding-mapping>
      <locale>ja</locale>
      <encoding>UTF-8</encoding>
    </locale-encoding-mapping>
  </locale-encoding-mapping-list>

</web-app>
