NoContent generator

A generator which does not return any content. It is the default generator used when no class is specified for a generator in services.xml.

Default generator

This generator is the default generator when the class attribute is specified for a generator in services.xml.

<service id="do-nothing" method="get">
  <url pattern="/empty"/>
  <generator name="empty"/>

The service configuration above is the equivalent of

<service id="do-nothing" method="get">
  <url pattern="/empty"/>
  <generator name="empty" class="org.pageseeder.berlioz.generator.NoContent"/>


The NoContent generator does not generate any content.

The example above would result in the following raw output from Berlioz:

<root service="topic" group="default">
    <location scheme="http" host="" port="80" path="/empty.html" query="" base="">
    <path info="/empty" extension=".html"/>
    <berlioz version="0.10.2" mode="web"/>
  <generator name="empty" class="org.pageseeder.berlioz.generator.NoContent"/>


This generator is useful in cases when a specific template rule should be applied by XSLT but that template does not use any content from the source XML. In other words, the template itself defines all that it needs to output.


A Web site has a common HTML footer defined as a template in XSLT but that footer should not appear on all pages. An easy way to define on which pages the footer should be displayed is to include the footer generator in the service.


<xsl:template match="content[@name='footer']">
  <footer>&#xA9; 2016</footer>


<service id="home" method="get">
  <url pattern="/home"/>
  <generator name="bundler" class="org.pageseeder.berlioz.bundler.GetWebBundles"/>
  <generator name="content" class="org.example.GetPageContent"/>
  <generator name="footer"/>

Created on , last edited on