<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>
  <!-- Order matters in web.xml! For the elements
       used in this example, this order is required:
          context-param
          servlet
          servlet-mapping
          welcome-file-list
          taglib
  -->
  
  <!-- Use the SPEL for expressions. -->
  <context-param>
    <param-name>
      javax.servlet.jsptl.ExpressionEvaluatorClass
    </param-name>
    <param-value>
      org.apache.taglibs.jsptl.lang.spel.Evaluator
    </param-value>
  </context-param>
  
  <!-- Give a name to the moreservlets.DefineCookies servlet
       so that a custom URL can later be assigned.
  -->
  <servlet>
    <servlet-name>DefineCookies</servlet-name>
    <servlet-class>moreservlets.DefineCookies</servlet-class>
  </servlet>
  
  <!-- Give a name to the moreservlets.ShowData servlet
       so that a custom URL can later be assigned.
  -->
  <servlet>
    <servlet-name>ShowData</servlet-name>
    <servlet-class>moreservlets.ShowData</servlet-class>
  </servlet>
  
  <!-- Register the URL /forEach/DefineCookies with the
       DefineCookies servlet. This prevents the servlet
       from needing to define a path of "/" for the cookies.
       Instead, the servlet (which sets the cookies) and the
       JSP pages (which display the cookies) have the same
       URL prefix, so no special settings are needed.
  -->
  <servlet-mapping>
    <servlet-name>DefineCookies</servlet-name>
    <url-pattern>/forEach/DefineCookies</url-pattern>
  </servlet-mapping>
  
  <!-- Register the URL /forEach/ShowData with the
       ShowData servlet. This lets the HTML form use
       a simple relative URL to invoke the servlet.
  -->
  <servlet-mapping>
    <servlet-name>ShowData</servlet-name>
    <url-pattern>/forEach/ShowData</url-pattern>
  </servlet-mapping>
  
  <!-- If URL gives a directory but no filename, try index.jsp
       first and index.html second. If neither is found,
       the result is server specific (e.g., a directory 
       listing).  Order of elements in web.xml matters. 
       welcome-file-list needs to come after servlet but
       before error-page.
  -->
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
  
  <!-- Register jr JSTL TLD file. -->
  <taglib>
    <taglib-uri>
      http://java.sun.com/jsptl/ea/jr
    </taglib-uri>
    <taglib-location>
      /WEB-INF/jsptl-tlds/jsptl-jr.tld
    </taglib-location>
  </taglib>
  
  <!-- Register jx JSTL TLD file. -->
  <taglib>
    <taglib-uri>
      http://java.sun.com/jsptl/ea/jx
    </taglib-uri>
    <taglib-location>
      /WEB-INF/jsptl-tlds/jsptl-jx.tld
    </taglib-location>
  </taglib>
</web-app>
