•  
Main
About Hippo Site Toolkit 1
Technical Documentation
Expression Language
Other

Deployment descriptor

The deployment descriptor (web.xml) describes how the application should be deployed. To be using Hippo Site Toolkit, it is common use to install two WebdavRepositoryFilters, one for the 'preview' site and one for the 'live' site. The filter-mappings should match the preview or live url prefixes, and a corresponding urlBasePath init-param must be present.

A WebdavRepositoryFilter makes a Java bean available in the request to use in the expression language and/or the tags. It also contains an URL Matcher, a filter component that matches URLs and maps them to the corresponding resources.

Besides WebdavRepositoryFilters, it is common to install a BinariesServlet to serve images from the repository.

The deployment descriptor in the JSF example application:

<?xml version="1.0"?>
<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">

    <description>JSP/JSF Toolkit for HippoCMS Repository - JSF example</description>

    <context-param>
        <description>State saving method: "client" or "server" (= default)
            See JSF Specification 2.5.3</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>

    <!-- Views are stored as *.xhtml (facelets) -->
    <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.xhtml</param-value>
    </context-param>

    <!-- additional tag libraries for facelets -->
    <!--
    <context-param>
        <param-name>facelets.LIBRARIES</param-name>
        <param-value>/META-INF/tomahawk.taglib.xml</param-value>
    </context-param>
    -->

    <!-- Special Debug Output for Development -->
    <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</param-value>
    </context-param>

      <!-- do render html comments in output (only for development) -->
      <context-param>
          <param-name>facelets.SKIP_COMMENTS</param-name>
          <param-value>false</param-value>
      </context-param>

    <filter>
        <filter-name>previewRepository</filter-name>
        <filter-class>nl.hippo.client.el.webdav.WebdavRepositoryFilter</filter-class>
        <init-param>
            <description>
                We use a special RequestURLMatcher that knows about the different
                JSPs (layouts) to be used.
            </description>
            <param-name>requestURLMatcher</param-name>
            <param-value>nl.hippo.client.jspexample.ExampleRequestURLMatcher</param-value>
        </init-param>
        <init-param>
            <description>
                The beginning of the URL path, same as value of filter-mapping, needed in URL matching.
            </description>      
            <param-name>urlBasePath</param-name>
            <param-value>/preview</param-value>
        </init-param>
        <init-param>
            <description>
                The configuration file path 
            </description>      
            <param-name>configurationFile</param-name>
            <param-value>/META-INF/preview.properties</param-value>
        </init-param>
    </filter>
    
    <filter>
        <filter-name>liveRepository</filter-name>
        <filter-class>nl.hippo.client.el.webdav.WebdavRepositoryFilter</filter-class>
        <init-param>
            <description>
                We use a special RequestURLMatcher that knows about the different
                JSPs (layouts) to be used.
            </description>
            <param-name>requestURLMatcher</param-name>
            <param-value>nl.hippo.client.jspexample.ExampleRequestURLMatcher</param-value>
        </init-param>
        <init-param>
            <description>
                The beginning of the URL path, same as value of filter-mapping, needed in URL matching.
            </description>      
            <param-name>urlBasePath</param-name>
            <param-value>/live</param-value>
        </init-param>
        <init-param>
            <description>
                The configuration file path 
            </description>      
            <param-name>configurationFile</param-name>
            <param-value>/META-INF/live.properties</param-value>
        </init-param>
    </filter>
    
    <filter-mapping>
        <filter-name>previewRepository</filter-name>
        <url-pattern>/preview/*</url-pattern>
        <!-- Only client requests but no forwards should be handled by this filter -->
        <dispatcher>REQUEST</dispatcher>  
    </filter-mapping>
    
    <filter-mapping>
        <filter-name>liveRepository</filter-name>
        <url-pattern>/live/*</url-pattern>
        <!-- Only client requests but no forwards should be handled by this filter -->
        <dispatcher>REQUEST</dispatcher>  
    </filter-mapping>
    
    <!-- Listener, to allow startup initialization of MyFaces in Jetty -->
    <listener>
        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>

    <!-- Faces Servlet -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- HST Binaries Servlet -->
    <servlet>
        <servlet-name>binariesServlet</servlet-name>
        <servlet-class>nl.hippo.client.el.servlet.BinariesServlet</servlet-class>
    </servlet>
    
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    
    <!-- HST Binaries Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>binariesServlet</servlet-name>
        <url-pattern>/binaries/*</url-pattern>
    </servlet-mapping>
    
    <!-- Welcome files -->
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>