•  
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 JSP 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 - JSP example</description>

    <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>
    
    <servlet>
        <servlet-name>binariesServlet</servlet-name>
        <servlet-class>nl.hippo.client.el.servlet.BinariesServlet</servlet-class>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>binariesServlet</servlet-name>
        <url-pattern>/binaries/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>