<?xml version="1.0" encoding="UTF-8"?>
<web-app id="docs"
  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_3_0.xsd"
  version="3.0"> 
  <display-name>Docs</display-name>

  <!-- This filter is used to secure URLs -->
  <filter>
    <filter-name>requestContextFilter</filter-name>
    <filter-class>com.sismics.util.filter.RequestContextFilter</filter-class>
  </filter>
  
  <filter-mapping>
    <filter-name>requestContextFilter</filter-name>
    <url-pattern>/api/*</url-pattern>
    <url-pattern>*.jsp</url-pattern>
  </filter-mapping>

  <!-- This filter is used to secure URLs -->
  <filter>
    <filter-name>tokenBasedSecurityFilter</filter-name>
    <filter-class>com.sismics.util.filter.TokenBasedSecurityFilter</filter-class>
  </filter>
  
  <filter-mapping>
    <filter-name>tokenBasedSecurityFilter</filter-name>
    <url-pattern>/api/*</url-pattern>
  </filter-mapping>

  <!-- Welcome files -->
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
  
  <!-- Jersey -->
  <servlet>
    <servlet-name>Jersey REST Service</servlet-name>
    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value>com.sismics.docs.rest.resource</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Jersey REST Service</servlet-name>
    <url-pattern>/api/*</url-pattern>
  </servlet-mapping>
</web-app>
