Tomcat: die web.xml Datei


Hinweis: aktuell werden die Einstellungen für das Guestbook und das Mail nicht verwendet. Es ist jedoch vorgesehen, diese in einer späteren Version zu verwenden. Aktuell werden diese Werte aus Konstanten übernommen, die auch angepasst werden müssen (siehe Konstanten anpassen..).

Aktuelle Version der web.xml Datei:

<?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>Welcome to trinity4 Weblog</display-name>
  <description>Welcome to trinity4 Weblog</description>

  <!-- Context initialization parameters that define shared
         String constants used within your application, which
         can be customized by the system administrator who is
         installing your application.  The values actually
         assigned to these parameters can be retrieved in a
         servlet or JSP page by calling:

             String value =
               getServletContext().getInitParameter("name");

         where "name" matches the <param-name> element of
         one of these initialization parameters.

         You can define any number of context initialization
         parameters, including zero.
  -->

  <!-- Context initialization parameters Mail -->
  <context-param>
      <param-name>webmaster</param-name>
      <param-value>madeleine.wegmann@hispeed.ch</param-value>
      <description>
        The EMAIL address of the administrator to whom questions
        and comments about this application should be addressed.
      </description>
  </context-param>


  <!-- Context initialization parameters for the FormHandling Forms Definition  -->
  <context-param>
      	<param-name>knownforms</param-name>
      	<param-value>/WEB-INF/xml/knownforms.xml</param-value>
  </context-param>

  <!-- Context initialization parameters for the FormHandling Forms Serialization  -->
  <context-param>
    	<param-name>serFormBeans</param-name>
    	<param-value>/WEB-INF/xml/serFormBeans.ser</param-value>
  </context-param>

  <!-- Context initialization parameters for the DB -->

  <!-- Ende Context initialization parameters for the DB -->

  <!-- Context initialization parameters for the guestbook -->
  <context-param>
    	<param-name>guest.xml</param-name>
    	<param-value>/WEB-INF/guestbook/guestbook.xml</param-value>
  </context-param>
  <context-param>
    	<param-name>guest.xsl</param-name>
    	<param-value>/WEB-INF/guestbook/guestbook.xsl</param-value>
  </context-param>
   <context-param>
    	<param-name>guest.html</param-name>
    	<param-value>/pages/guestbook/guestbook.html</param-value>
  </context-param>
  <!-- Ende Context initialization parameters for the guestbook -->

  <!-- Context initialization parameters for the news -->
  <!-- Ende Context initialization parameters for the news -->

  <!-- Context initialization parameters for the forum -->
  <!-- Ende Context initialization parameters for the forum -->

  <!-- Listeners -->
  <listener>
       <listener-class>com.trinity4.weblog.listeners.XMLHandler</listener-class>
       <listener-class>com.trinity4.weblog.listeners.FormHandler</listener-class>
       <listener-class>com.trinity4.weblog.listeners.ConnectionPoolHandler</listener-class>
       <listener-class>com.trinity4.weblog.listeners.HttpSessionHandler</listener-class>
  </listener>

  <!-- filters -->

  <!-- Servlet Configuration -->
 <servlet>
          <servlet-name>XMLHandler</servlet-name>
          <display-name>XMLHandler</display-name>
          <description>Session Context forming XML, XSL Files to HTML Files</description>
          <servlet-class>com.trinity4.weblog.listeners.XMLHandler</servlet-class>
  </servlet>

  <servlet>
          <servlet-name>FormHandler</servlet-name>
          <display-name>FormHandler</display-name>
          <description>Session Context Forms Form Handler</description>
          <servlet-class>com.trinity4.weblog.listeners.FormHandler</servlet-class>
  </servlet>

  <servlet>
        <servlet-name>ConnectionPoolHandler</servlet-name>
        <display-name>ConnectionPoolHandler</display-name>
        <description>Session Context Weblog DB Connection Pool Handler</description>
        <servlet-class>com.trinity4.weblog.listeners.ConnectionPoolHandler</servlet-class>
  </servlet>

  <servlet>
    <servlet-name>FrontController</servlet-name>
    <display-name>FrontController</display-name>
    <description>Front Controller for the Weblog</description>
    <servlet-class>com.trinity4.weblog.controller.FrontControllerServlet</servlet-class>
    <init-param>
      <param-name>default_locale</param-name>
      <param-value>de_CH</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
  </servlet>


  <servlet>
      <servlet-name>HttpSessionHandler</servlet-name>
      <display-name>HttpSessionHandler</display-name>
      <description>Weblog HttpSession Handler</description>
      <servlet-class>com.trinity4.weblog.listeners.HttpSessionHandler</servlet-class>
  </servlet>


  <!-- Servlet Mapping -->
  <servlet-mapping>
      <servlet-name>FrontController</servlet-name>
      <url-pattern>*.do</url-pattern>
  </servlet-mapping>

  <!-- Session config -->
  <session-config>
      <session-timeout>30</session-timeout>
  </session-config>


  <welcome-file-list>
    <welcome-file>pages/hsz-weblog/index.jsp</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

  <!-- error Page -->

  <!-- Taglibs -->

  <taglib>
     <taglib-uri>com.trinity4.weblog.resources.taglibs-i18n</taglib-uri>
     <taglib-location>/WEB-INF/tld/taglibs-i18n.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>trinity4.tld</taglib-uri>
      <taglib-location>/WEB-INF/tld/taglibs-trinity4.tld
      </taglib-location>
  </taglib>

</web-app>