<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2004-2009 the Seasar Foundation and the Others.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    either express or implied. See the License for the specific language
    governing permissions and limitations under the License.

-->
<web-app 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"
		version="2.5">

	<filter>
		<filter-name>senderror</filter-name>
		<filter-class>org.seasar.cubby.filter.SendErrorFilter</filter-class>
        <init-param>
            <param-name>statusCode</param-name>
            <param-value>404</param-value>
        </init-param>
        <!-- 
        <init-param>
            <param-name>ignorePathPattern</param-name>
            <param-value>.*/index.jsp</param-value>
        </init-param>
        -->
	</filter>

    <filter>
        <filter-name>encoding</filter-name>
        <filter-class>org.seasar.cubby.filter.EncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>

    <filter>
        <filter-name>hotdeploy</filter-name>
        <filter-class>org.seasar.framework.container.hotdeploy.HotdeployFilter</filter-class>
    </filter>

    <filter>
        <filter-name>s2container</filter-name>
        <filter-class>org.seasar.framework.container.filter.S2ContainerFilter</filter-class>
    </filter>

    <!--
    <filter>
        <filter-name>requestDumpFilter</filter-name>
        <filter-class>org.seasar.extension.filter.RequestDumpFilter</filter-class>
    </filter>
    -->

    <filter>
        <filter-name>cubby</filter-name>
        <filter-class>org.seasar.cubby.filter.CubbyFilter</filter-class>
        <init-param>
            <param-name>ignorePathPattern</param-name>
            <param-value>/css/.*,/js/.*,/img/.*</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>senderror</filter-name>
        <url-pattern>*.jsp</url-pattern>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>encoding</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>hotdeploy</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>s2container</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

    <!--
    <filter-mapping>
        <filter-name>requestdump</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    -->

    <filter-mapping>
        <filter-name>cubby</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

    <servlet>
        <servlet-name>s2container</servlet-name>
        <servlet-class>org.seasar.framework.container.servlet.S2ContainerServlet</servlet-class>
        <init-param>
            <param-name>configPath</param-name>
            <param-value>app.dicon</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

	<servlet>
		<servlet-name>cubby</servlet-name>
		<servlet-class>org.seasar.cubby.servlet.CubbyServlet</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>

    <servlet>
        <servlet-name>cubbyadmin</servlet-name>
        <servlet-class>org.seasar.cubby.admin.servlet.CubbyAdminServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>s2container</servlet-name>
        <url-pattern>/s2container/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>cubbyadmin</servlet-name>
        <url-pattern>/cubby-admin</url-pattern>
    </servlet-mapping>

    <!--
    <session-config>
        <session-timeout>1</session-timeout>
    </session-config>
    -->

    <welcome-file-list>
        <welcome-file>/</welcome-file>
    </welcome-file-list>

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <el-ignored>false</el-ignored>
            <page-encoding>UTF-8</page-encoding>
            <scripting-invalid>false</scripting-invalid>
            <include-prelude>/common/header.jsp</include-prelude>
            <trim-directive-whitespaces>true</trim-directive-whitespaces>
        </jsp-property-group>
    </jsp-config>

</web-app>