org.glassfish.jersey.server.mvc
Annotation Type ErrorTemplate


@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
@Documented
@Beta
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 (michal.gajdos at oracle.com)
See Also:
Template, AbstractErrorTemplateMapper

Optional Element Summary
 String name
          The template name that should be used to display an error raised during processing a request.
 

name

public abstract 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:
""


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.