Annotation Interface ErrorTemplate


@Retention(RUNTIME) @Target({TYPE,METHOD}) @Documented public @interface ErrorTemplate
Used to annotate JAX-RS resources and resource methods to provide reference to an error template if an exception has been raised during processing a request (resource method invocation).

The processing of this annotation is similar to the processing of Template annotation with the difference that the thrown exception (or an object derived from the exception) is used as a model for the defined template.

By default every exception is mapped to a viewable and passed to the MVC runtime for further processing.

Note: The ErrorTemplate annotation can be used even in case when neither viewable is used as return value of a resource method nor Template annotation is used to annotate the resource method or resource class.

Since:
2.3
Author:
Michal Gajdos
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The template name that should be used to display an error raised during processing a request.
  • Element Details

    • name

      String name
      The template name that should be used to display an error raised during processing a request. The template name may be declared as absolute template name if the name begins with a '/', otherwise the template name is recognized to be relative.
      Default:
      ""