Web descriptor

/WEB-INF/web.xml

The Web descriptor is the general configuration used by the servlet container.

To properly configure and invoke Berlioz, it is critical the servlets be declared, and where necessary, mapped. This article describes the available options. 

Note

Users of a pre-configured Kickstart solution will not need to update the Web descriptor. 

Initialization

When initializing Berlioz, the most reliable mechanism is the initialization servlet. In addition to displaying a useful diagnostic at startup, this servlet is responsible for the following:

  • loading the global properties;
  • checking the environment;
  • setting up the logging.

This servlet should not be mapped.

<servlet>
  <servlet-name>Initialiser</servlet-name>
  <servlet-class>org.pageseeder.berlioz.servlet.InitServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>

Parameters

The following parameters are valid for initialization.

namevaluedescription
lifecycle-listenernullClass name of a listener to be notified of Berlioz events
modenullDefines the Berlioz mode

 

Berlioz Servlet

A common configuration maps the Berlioz servlet to a file extension to be invoked when that suffix (or an equivalent prefix) is present in the request URL. 

<servlet>
  <servlet-name>BerliozHTML</servlet-name> 
  <servlet-class>org.pageseeder.berlioz.servlet.BerliozServlet</servlet-class>
  <init-param>
    <param-name>stylesheet</param-name> 
    <param-value>/xslt/html/{GROUP}.xsl</param-value> 
  </init-param> 
  <init-param> 
  <param-name>content-type</param-name> 
    <param-value>text/html;charset=utf-8</param-value> 
  </init-param> 
  <load-on-startup>3</load-on-startup>
</servlet>

See this link for more examples of the standard mapping syntax.

<servlet-mapping> 
  <servlet-name>BerliozHTML</servlet-name> 
 <url-pattern>*.html</url-pattern> 
</servlet-mapping> 

Created on , last edited on