Skip to main content

 Advanced

Advanced topics

Generator: GetErrorDetails

Class name:org.weborganic.berlioz.generator.GetErrorDetails
Version:Berlioz 0.9.0 - 13 October 2011
Library:Berlioz
Cacheable:No
Generated:2012-12-21

Description

Generates no content.

This content generator is useful to display information about errors, when a Berlioz service is used for error handling.

Configuration

There is no configuration directly associated with this generator.

However, since the purpose is to display servlet error details, the services using this generator should have their URLs mapped in the Web descriptor for error catching. For example:

<error-page>
  <error-code>404</error-code>
  <location>/not-found.html</location>
</error-page>

Parameters

This generator does not use and require any parameter.

Attributes

This generator tries to retrieve values from the standard Servlet error request attributes.

Returned XML

This generator does not have any content, so the XML content is always empty.

Since Berlioz always wraps generators’ content, the final XML is always:

<content generator="org.weborganic.berlioz.generator.GetErrorDetails"
         name="[name]"
         target="[target]"
         status="ok">
  <error http-class="[http-class]"
         http-code="[http-code]"
         datetime="[iso8601-datetime]"
         id="[berlioz-id]">
    <title>Not Found</title>
    <message>Not Found</message>
    <request-uri>/fdhvjfdls</request-uri>
    <!-- Any exception will be serialized as XML here -->
  </error>
</content>
 

Note: since this generator does produce any data, the return status is always ok.

Usage

To use this generator in Berlioz (in /WEB-INF/config/services.xml ):

<generator class="org.weborganic.berlioz.generator.GetErrorDetails"
           name="[name]"
           target="[target]"/>

Etag

This generator is not cacheable.

Created on , last edited on