<?xml version="1.0" encoding="ISO-8859-1"?>
<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_3_0.xsd"
   metadata-complete="false"
   version="3.0"> 

  <display-name>Test WebApp</display-name>
  
  <context-param>
    <param-name>org.eclipse.jetty.server.context.ManagedAttributes</param-name>
    <param-value>QoSFilter,TransparentProxy.ThreadPool,TransparentProxy.HttpClient</param-value>
  </context-param>
  
  <!-- Declare TestListener, which declares TestFilter -->
  <listener>
    <listener-class>com.acme.TestListener</listener-class>
  </listener>


  <filter>
    <filter-name>QoSFilter</filter-name>
    <filter-class>org.eclipse.jetty.servlets.QoSFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
      <param-name>maxRequests</param-name>
      <param-value>10000</param-value>
    </init-param>
    <init-param>
      <param-name>managedAttr</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>  
  <filter-mapping>
    <filter-name>QoSFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>


  <filter>
    <filter-name>MultiPart</filter-name>
    <filter-class>org.eclipse.jetty.servlets.MultiPartFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
      <param-name>deleteFiles</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>MultiPart</filter-name>
    <url-pattern>/dump/*</url-pattern>
  </filter-mapping>
  

  <filter>
    <filter-name>GzipFilter</filter-name>
    <filter-class>org.eclipse.jetty.servlets.IncludableGzipFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
      <param-name>bufferSize</param-name>
      <param-value>8192</param-value>
    </init-param>
    <init-param>
      <param-name>mimeTypes</param-name>
      <param-value>text/plain,application/xml</param-value>
    </init-param>
    <init-param>
      <param-name>minGzipSize</param-name>
      <param-value>2048</param-value>
    </init-param>
    <init-param>
      <param-name>userAgent</param-name>
      <param-value>(?:Mozilla[^\(]*\(compatible;\s*+([^;]*);.*)|(?:.*?([^\s]+/[^\s]+).*)</param-value>
    </init-param>
    <init-param>
      <param-name>cacheSize</param-name>
      <param-value>1024</param-value>
    </init-param>
    <init-param>
      <param-name>excludedAgents</param-name>
      <param-value>MSIE 6.0</param-value>
    </init-param>
    <init-param>
      <param-name>uncheckedPrintWriter</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>GzipFilter</filter-name>
    <url-pattern>/dump/gzip/*</url-pattern>
    <url-pattern>*.txt</url-pattern>
  </filter-mapping>
  
  
  <servlet>
    <servlet-name>Login</servlet-name>
    <servlet-class>com.acme.LoginServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>Login</servlet-name>
    <url-pattern>/login/*</url-pattern>
  </servlet-mapping>


  <servlet>
    <servlet-name>Hello</servlet-name>
    <servlet-class>com.acme.HelloWorld</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>Hello</servlet-name>
    <url-pattern>/hello/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>Dump</servlet-name>
    <servlet-class>com.acme.Dump</servlet-class>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
    <run-as><role-name>admin</role-name></run-as>
  </servlet>

  <servlet-mapping>
    <servlet-name>Dump</servlet-name>
    <url-pattern>/dump/*</url-pattern>
    <url-pattern>*.dump</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>Session</servlet-name>
    <servlet-class>com.acme.SessionDump</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>Session</servlet-name>
    <url-pattern>/session/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>Cookie</servlet-name>
    <servlet-class>com.acme.CookieDump</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>Cookie</servlet-name>
    <url-pattern>/cookie/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>Dispatch</servlet-name>
    <servlet-class>com.acme.DispatchServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>Dispatch</servlet-name>
    <url-pattern>/dispatch/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>CGI</servlet-name>
    <servlet-class>org.eclipse.jetty.servlets.CGI</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>CGI</servlet-name>
    <url-pattern>/cgi-bin/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>Chat</servlet-name>
    <servlet-class>com.acme.ChatServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>

  <servlet-mapping>
    <servlet-name>Chat</servlet-name>
    <url-pattern>/chat/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>WSChat</servlet-name>
    <servlet-class>com.acme.WebSocketChatServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>WSChat</servlet-name>
    <url-pattern>/ws/*</url-pattern>
  </servlet-mapping>
  
  
  <servlet>
    <servlet-name>Rewrite</servlet-name>
    <servlet-class>com.acme.RewriteServlet</servlet-class>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>Rewrite</servlet-name>
    <url-pattern>/rewritten/*</url-pattern>
    <url-pattern>/redirected/*</url-pattern>
  </servlet-mapping>
  
  
  <servlet>
    <servlet-name>SecureMode</servlet-name>
    <servlet-class>com.acme.SecureModeServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>SecureMode</servlet-name>
    <url-pattern>/secureMode/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
     <servlet-name>foo.jsp</servlet-name>
     <jsp-file>/jsp/foo/foo.jsp</jsp-file>
  </servlet>
  <servlet-mapping>
    <servlet-name>foo.jsp</servlet-name>
    <url-pattern>/jsp/foo/</url-pattern>
  </servlet-mapping>

  <error-page>
    <error-code>404</error-code>
    <location>/error404.html</location>
  </error-page>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Rego2</web-resource-name>
      <url-pattern>/rego2/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>server-administrator</role-name>
    </auth-constraint>
  </security-constraint>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Auth2</web-resource-name>
      <url-pattern>/auth2/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>*</role-name>
    </auth-constraint>
  </security-constraint>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Any User</web-resource-name>
      <url-pattern>/dump/auth/*</url-pattern>
      <url-pattern>*.htm</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>*</role-name>
    </auth-constraint>
  </security-constraint>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>relax</web-resource-name>
      <url-pattern>/dump/auth/relax/*</url-pattern>
      <url-pattern>/auth/relax.txt</url-pattern>
      <http-method>GET</http-method>
      <http-method>HEAD</http-method>
    </web-resource-collection>
  </security-constraint>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Admin Role</web-resource-name>
      <url-pattern>/dump/auth/admin/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>admin</role-name>
    </auth-constraint>
  </security-constraint>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Forbidden</web-resource-name>
      <url-pattern>/dump/auth/noaccess/*</url-pattern>
      <url-pattern>/auth/*</url-pattern>
    </web-resource-collection>
    <auth-constraint/>
  </security-constraint>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>SSL</web-resource-name>
      <url-pattern>/dump/auth/ssl/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

<!--
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Test Realm</realm-name>
  </login-config>
-->

<!--
  <login-config>
    <auth-method>DIGEST</auth-method>
    <realm-name>Test Realm</realm-name>
  </login-config>
-->

  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Test Realm</realm-name>
    <form-login-config>
       <form-login-page>/logon.html?param=test</form-login-page>
       <form-error-page>/logonError.html?param=test</form-error-page>
    </form-login-config>
  </login-config>
  
  <session-config>
    <session-timeout>5</session-timeout>
  </session-config>

  <security-role>
    <role-name>admin</role-name>
  </security-role>
  <security-role>
    <role-name>user</role-name>
  </security-role>

</web-app>


