<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>JAAS Test</display-name>


  <servlet>
    <servlet-name>JAAS Test Page</servlet-name>
    <servlet-class id="xx">org.mortbay.webapps.jaas.Servlet</servlet-class>
    <init-param>
      <param-name>dbDriver</param-name>
      <param-value>@dbDriver</param-value>
    </init-param>
    <init-param>
      <param-name>dbUrl</param-name>
      <param-value>@dbUrl</param-value>
    </init-param>
    <init-param>
      <param-name>dbUserName</param-name>
      <param-value>@dbUserName</param-value>
    </init-param>
    <init-param>
      <param-name>dbPassword</param-name>
      <param-value>@dbPassword</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <security-role-ref>
      <role-name>roleA</role-name>
      <role-link>roleA</role-link>
    </security-role-ref>
  </servlet>



  <servlet>
    <servlet-name>Dump</servlet-name>
    <servlet-class>org.mortbay.servlet.Dump</servlet-class>
    <load-on-startup>0</load-on-startup>
   </servlet>

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


  <servlet-mapping>
    <servlet-name>JAAS Test Page</servlet-name>
    <url-pattern>/doit/*</url-pattern>
  </servlet-mapping>


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

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

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

  <error-page>
    <error-code>401</error-code>
    <location>/error401.html</location>
  </error-page>


  <security-constraint>
    <web-resource-collection>
      <web-resource-name>JAAS Role</web-resource-name>
      <url-pattern>/doit/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>roleA</role-name>
    </auth-constraint>
  </security-constraint>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>JAAS Role</web-resource-name>
      <url-pattern>/auth.html</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>roleA</role-name>
    </auth-constraint>
  </security-constraint>


  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Test JAAS Realm</realm-name>
    <form-login-config>
      <form-login-page>
        /login.html
      </form-login-page>
      <form-error-page>
        /error401.html
      </form-error-page>
    </form-login-config>
  </login-config>
</web-app>
