<?xml version="1.0" encoding="UTF-8"?>
<web-app 
   xmlns="http://xmlns.jcp.org/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
   metadata-complete="false"
   version="3.1"> 

  <display-name>Test Annotations WebApp</display-name>
  
  <listener>
    <listener-class>com.acme.test.TestListener</listener-class>
  </listener>


  <servlet>
    <servlet-name>AnnotationTest</servlet-name>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>AnnotationTest</servlet-name>
    <url-pattern>/test/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>RoleAnnotationTest</servlet-name>
    <servlet-class>com.acme.test.RoleAnnotationTest</servlet-class>
    <load-on-startup>1</load-on-startup>
    <security-role-ref>
      <role-name>manager</role-name>
      <role-link>server-administrator</role-link>
    </security-role-ref>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>RoleAnnotationTest</servlet-name>
    <url-pattern>/role/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>Multi</servlet-name>
    <servlet-class>com.acme.test.MultiPartTest</servlet-class>
    <load-on-startup>2</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>Multi</servlet-name>
    <url-pattern>/multi/*</url-pattern>
  </servlet-mapping>

  <env-entry>
    <env-entry-name>com.acme.test.AnnotationTest/avgAmount</env-entry-name>
    <env-entry-type>java.lang.Double</env-entry-type>
    <env-entry-value>1.25</env-entry-value>
  </env-entry>

  <env-entry>
    <env-entry-name>someAmount</env-entry-name>
    <env-entry-type>java.lang.Double</env-entry-type>
    <env-entry-value>0.99</env-entry-value>
  </env-entry>

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

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

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


<!--
  <login-config>
    <auth-method>BASIC</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>
        /login.html
      </form-login-page>
      <form-error-page>
        /authfail.html
      </form-error-page>
    </form-login-config>
  </login-config>


</web-app>
