home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / web.xml.txt < prev    next >
Encoding:
Extensible Markup Language  |  2004-08-28  |  5.5 KB  |  151 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.  
  3. <!DOCTYPE web-app 
  4.     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
  5.     "http://java.sun.com/dtd/web-app_2_3.dtd">
  6.  
  7. <web-app>
  8.  
  9.  
  10.     <!-- General description of your web application -->
  11.  
  12.     <display-name>My Web Application</display-name>
  13.     <description>
  14.       This is version X.X of an application to perform
  15.       a wild and wonderful task, based on servlets and
  16.       JSP pages.  It was written by Dave Developer
  17.       (dave@mycompany.com), who should be contacted for
  18.       more information.
  19.     </description>
  20.  
  21.  
  22.     <!-- Context initialization parameters that define shared
  23.          String constants used within your application, which
  24.          can be customized by the system administrator who is
  25.          installing your application.  The values actually
  26.          assigned to these parameters can be retrieved in a
  27.          servlet or JSP page by calling:
  28.  
  29.              String value =
  30.                getServletContext().getInitParameter("name");
  31.  
  32.          where "name" matches the <param-name> element of
  33.          one of these initialization parameters.
  34.  
  35.          You can define any number of context initialization
  36.          parameters, including zero.
  37.     -->
  38.  
  39.     <context-param>
  40.       <param-name>webmaster</param-name>
  41.       <param-value>myaddress@mycompany.com</param-value>
  42.       <description>
  43.         The EMAIL address of the administrator to whom questions
  44.         and comments about this application should be addressed.
  45.       </description>
  46.     </context-param>
  47.  
  48.  
  49.     <!-- Servlet definitions for the servlets that make up
  50.          your web application, including initialization
  51.          parameters.  With Tomcat, you can also send requests
  52.          to servlets not listed here with a request like this:
  53.  
  54.            http://localhost:8080/{context-path}/servlet/{classname}
  55.  
  56.          but this usage is not guaranteed to be portable.  It also
  57.          makes relative references to images and other resources
  58.          required by your servlet more complicated, so defining
  59.          all of your servlets (and defining a mapping to them with
  60.          a servlet-mapping element) is recommended.
  61.  
  62.          Servlet initialization parameters can be retrieved in a
  63.          servlet or JSP page by calling:
  64.  
  65.              String value =
  66.                getServletConfig().getInitParameter("name");
  67.  
  68.          where "name" matches the <param-name> element of
  69.          one of these initialization parameters.
  70.  
  71.          You can define any number of servlets, including zero.
  72.     -->
  73.  
  74.     <servlet>
  75.       <servlet-name>controller</servlet-name>
  76.       <description>
  77.         This servlet plays the "controller" role in the MVC architecture
  78.         used in this application.  It is generally mapped to the ".do"
  79.         filename extension with a servlet-mapping element, and all form
  80.         submits in the app will be submitted to a request URI like
  81.         "saveCustomer.do", which will therefore be mapped to this servlet.
  82.  
  83.         The initialization parameter namess for this servlet are the
  84.         "servlet path" that will be received by this servlet (after the
  85.         filename extension is removed).  The corresponding value is the
  86.         name of the action class that will be used to process this request.
  87.       </description>
  88.       <servlet-class>com.mycompany.mypackage.ControllerServlet</servlet-class>
  89.       <init-param>
  90.         <param-name>listOrders</param-name>
  91.         <param-value>com.mycompany.myactions.ListOrdersAction</param-value>
  92.       </init-param>
  93.       <init-param>
  94.         <param-name>saveCustomer</param-name>
  95.         <param-value>com.mycompany.myactions.SaveCustomerAction</param-value>
  96.       </init-param>
  97.       <!-- Load this servlet at server startup time -->
  98.       <load-on-startup>5</load-on-startup>
  99.     </servlet>
  100.  
  101.     <servlet>
  102.       <servlet-name>graph</servlet-name>
  103.       <description>
  104.         This servlet produces GIF images that are dynamically generated
  105.         graphs, based on the input parameters included on the request.
  106.         It is generally mapped to a specific request URI like "/graph".
  107.       </description>
  108.     </servlet>
  109.  
  110.  
  111.     <!-- Define mappings that are used by the servlet container to
  112.          translate a particular request URI (context-relative) to a
  113.          particular servlet.  The examples below correspond to the
  114.          servlet descriptions above.  Thus, a request URI like:
  115.  
  116.            http://localhost:8080/{contextpath}/graph
  117.  
  118.          will be mapped to the "graph" servlet, while a request like:
  119.  
  120.            http://localhost:8080/{contextpath}/saveCustomer.do
  121.  
  122.          will be mapped to the "controller" servlet.
  123.  
  124.          You may define any number of servlet mappings, including zero.
  125.          It is also legal to define more than one mapping for the same
  126.          servlet, if you wish to.
  127.     -->
  128.  
  129.     <servlet-mapping>
  130.       <servlet-name>controller</servlet-name>
  131.       <url-pattern>*.do</url-pattern>
  132.     </servlet-mapping>
  133.  
  134.     <servlet-mapping>
  135.       <servlet-name>graph</servlet-name>
  136.       <url-pattern>/graph</url-pattern>
  137.     </servlet-mapping>
  138.  
  139.  
  140.     <!-- Define the default session timeout for your application,
  141.          in minutes.  From a servlet or JSP page, you can modify
  142.          the timeout for a particular session dynamically by using
  143.          HttpSession.getMaxInactiveInterval(). -->
  144.  
  145.     <session-config>
  146.       <session-timeout>30</session-timeout>    <!-- 30 minutes -->
  147.     </session-config>
  148.  
  149.  
  150. </web-app>
  151.