<web-app id="geobatch" version="2.4" 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">
	<display-name>GeoBatch</display-name>
	<description>GeoSolutions GeoBatch</description>
 
	<context-param>
		<param-name>log4jConfigLocation</param-name>
   		<param-value>WEB-INF/log4j.xml</param-value>
	</context-param>
	
   	<listener>
   		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
   	</listener>
	
	<!-- pick up all spring application contexts -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			classpath*:/applicationContext.xml 
			WEB-INF/applicationContextSecurity.xml</param-value>
	</context-param>
	<!--  spring context loader -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<!-- spring dispatcher servlet, dispatches incoming requests to controllers -->
	<servlet>
		<servlet-name>geobatch</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	
	<!-- Restlet adapter -->
    <servlet>
        <servlet-name>rservlet</servlet-name>
        <servlet-class>
             com.noelios.restlet.ext.spring.RestletFrameworkServlet
        </servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath*:/rservlet-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
	
	<!-- context-param>
		<param-name>GEOBATCH_DATA_DIR</param-name>
		<param-value>/opt/geobatch/data</param-value>
	</context-param-->
	<servlet-mapping>
		<servlet-name>geobatch</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>geobatch</servlet-name>
		<url-pattern>*.form</url-pattern>
	</servlet-mapping>

    <!-- Catch all request URIs starting with  prefix /rest-->
    <servlet-mapping>
        <servlet-name>rservlet</servlet-name>
        <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>

	<filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

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

    <!--
      - Publishes events for session creation and destruction through the application
      - context. Optional unless concurrent session control is being used.
      -->
    <!-- listener>
      <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
    </listener -->

        
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
	
	<error-page>
        <error-code>
            403
        </error-code>
        <location>
            /error/403.jsp
        </location>
    </error-page>
    
</web-app>