<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app 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" version="2.4">

  <display-name>Jetty Demo</display-name>

  <context-param>
    <param-name>home</param-name>
    <param-value>http://jetty.mortbay.org</param-value>
  </context-param>

  <context-param>
    <param-name>admin</param-name>
    <param-value>mortbay@mortbay.com</param-value>
  </context-param>

  <!-- set the path for session cookies. Needs to be common for all webapps sharing 
       the same session ID space -->
  <context-param>
    <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
    <param-value>/</param-value>
  </context-param>

  <!-- Uncomment to demo listeners
  -->
  <listener>
    <listener-class>org.mortbay.webapps.jetty.DemoListener</listener-class>
  </listener>
  
  <filter>
    <filter-name>Demo REQUEST Filter</filter-name>
    <filter-class>org.mortbay.webapps.jetty.DemoFilter</filter-class>
    <init-param><param-name>type</param-name><param-value>REQUEST</param-value></init-param>
    <init-param><param-name>wrap</param-name><param-value>FALSE</param-value></init-param>
  </filter>
  
  <filter>
    <filter-name>Demo FORWARD Filter</filter-name>
    <filter-class>org.mortbay.webapps.jetty.DemoFilter</filter-class>
    <init-param><param-name>type</param-name><param-value>FORWARD</param-value></init-param>
  </filter>
  
  <filter>
    <filter-name>Demo INCLUDE Filter</filter-name>
    <filter-class>org.mortbay.webapps.jetty.DemoFilter</filter-class>
    <init-param><param-name>type</param-name><param-value>INCLUDE</param-value></init-param>
  </filter>
  
  <filter>
    <filter-name>Demo ERROR Filter</filter-name>
    <filter-class>org.mortbay.webapps.jetty.DemoFilter</filter-class>
    <init-param><param-name>type</param-name><param-value>ERROR</param-value></init-param>
  </filter>
  
  <filter>
    <filter-name>Demo Named Filter</filter-name>
    <filter-class>org.mortbay.webapps.jetty.DemoFilter</filter-class>
    <init-param><param-name>type</param-name><param-value>Named</param-value></init-param>
  </filter>

  <filter-mapping>
      <filter-name>Demo REQUEST Filter</filter-name>
      <url-pattern>/*</url-pattern>
      <dispatcher>REQUEST</dispatcher>
  </filter-mapping>

  <filter-mapping>
      <filter-name>Demo FORWARD Filter</filter-name>
      <url-pattern>/*</url-pattern>
      <dispatcher>FORWARD</dispatcher>
  </filter-mapping>
  
  <filter-mapping>
      <filter-name>Demo INCLUDE Filter</filter-name>
      <url-pattern>/*</url-pattern>
      <dispatcher>INCLUDE</dispatcher>
  </filter-mapping>
  
  <filter-mapping>
      <filter-name>Demo ERROR Filter</filter-name>
      <url-pattern>/*</url-pattern>
      <dispatcher>ERROR</dispatcher>
  </filter-mapping>
  
  <filter-mapping>
      <filter-name>Demo Named Filter</filter-name>
      <servlet-name>Dump</servlet-name>
      <dispatcher>FORWARD</dispatcher>
  </filter-mapping>


  <!-- A sample filter that allows servlets to be used as welcome 
       files without the need for the file to exist.
       Uncomment to activate.
  <filter>
    <filter-name>Welcome Filter</filter-name>
    <filter-class>org.mortbay.servlet.WelcomeFilter</filter-class>
    <init-param>
      <param-name>welcome</param-name>
      <param-value>index.jsp</param-value>
    </init-param>
  </filter>
  <filter-mapping>
      <filter-name>Welcome Filter</filter-name>
      <url-pattern>/</url-pattern>
      <dispatcher>REQUEST</dispatcher>
  </filter-mapping>
  -->

  <servlet>
    <servlet-name>Jetty Demo Page</servlet-name>
    <servlet-class id="xx">org.mortbay.webapps.jetty.JettyServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>Jetty Faq Generator</servlet-name>
    <servlet-class id="yy">org.mortbay.webapps.jetty.FaqServlet</servlet-class>
    <init-param>
        <param-name>srcDir</param-name>
	<param-value>faq</param-value>
    </init-param>
    <init-param>
        <param-name>refreshMSec</param-name>
	<param-value>10000</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>JSP Snoop</servlet-name>
    <jsp-file>/snoop.jsp</jsp-file>
  </servlet>

  <servlet>
    <servlet-name>Dump</servlet-name>
    <servlet-class>org.mortbay.servlet.Dump</servlet-class>
    <load-on-startup>0</load-on-startup>
    <security-role-ref>
      <role-name>dumpRole</role-name>
      <role-link>server-administrator</role-link>
    </security-role-ref>
 </servlet>

  <servlet>
    <servlet-name>Dispatch</servlet-name>
    <servlet-class>org.mortbay.webapps.jetty.RequestDispatchTest</servlet-class>
    <run-as><role-name>dispatch</role-name></run-as>
  </servlet>

  <servlet>
    <servlet-name>Session</servlet-name>
    <servlet-class>org.mortbay.servlet.SessionDump</servlet-class>
  </servlet>

  <servlet>
    <servlet-name>SendRedirect</servlet-name>
    <servlet-class>org.mortbay.servlet.SendRedirect</servlet-class>
  </servlet>

  <servlet>
    <servlet-name>ExServlet</servlet-name>
    <servlet-class>org.mortbay.webapps.jetty.ExServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>Jetty Demo Page</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>Jetty Faq Generator</servlet-name>
    <url-pattern>/faq/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>Jetty Demo Page</servlet-name>
    <url-pattern>*.txt</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>JSP Snoop</servlet-name>
    <url-pattern>/jspsnoop/*</url-pattern>
  </servlet-mapping>

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

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

  <servlet-mapping>
    <servlet-name>Dispatch</servlet-name>
    <url-pattern>/dispatch/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>Session</servlet-name>
    <url-pattern>/session/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>SendRedirect</servlet-name>
    <url-pattern>/sendredirect/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>ExServlet</servlet-name>
    <url-pattern>/exception/*</url-pattern>
  </servlet-mapping>

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

  <error-page>
    <error-code>401</error-code>
    <location>/error401.html</location>
  </error-page>
  <error-page>
    <error-code>403</error-code>
    <location>/error403.html</location>
  </error-page>
  <error-page>
    <error-code>404</error-code>
    <location>/error404.html</location>
  </error-page>
  <error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
    <location>/dump/NPE</location>
  </error-page>
  <error-page>
    <exception-type>java.io.IOException</exception-type>
    <location>/dump/IOE</location>
  </error-page>
  <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/dump/Throwable</location>
  </error-page>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Any User</web-resource-name>
      <url-pattern>/auth/*</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>/auth/relax/*</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>relaxText</web-resource-name>
      <url-pattern>*.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>/auth/admin/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>content-administrator</role-name>
    </auth-constraint>
  </security-constraint>

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

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>SSL</web-resource-name>
      <url-pattern>/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>Jetty Demo Realm</realm-name>
  </login-config>

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

<!--
  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Jetty Demo Realm</realm-name>
    <form-login-config>
       <form-login-page>/auth/logon.html?param=test</form-login-page>
       <form-error-page>/auth/logonError.html?param=test</form-error-page>
    </form-login-config>
  </login-config>
-->

  <security-role>
      <role-name>adminRef</role-name>
  </security-role>

  <security-role>
      <role-name>server-administrator</role-name>
  </security-role>
</web-app>


