@Retention(value=RUNTIME) @Target(value={TYPE,METHOD}) @Documented public @interface ErrorTemplate
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.Template,
AbstractErrorTemplateMapper| Modifier and Type | Optional Element and Description |
|---|---|
String |
name
The template name that should be used to display an error raised during processing a request.
|
Class<?> |
resolvingClass
The class to be used to resolve the error template name if the error template name is not absolute.
|
public abstract String name
public abstract Class<?> resolvingClass
Object.class then the resolving class will be obtained from the last matched resource.
Defaults to Object.Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.