Annotation Interface Template


@Inherited @Target({TYPE,METHOD}) @Retention(RUNTIME) public @interface Template
Used to annotate JAX-RS resources and resource methods to provide reference to a template for MVC support.

In case a resource class is annotated with Template annotation then an instance of this class is considered to be the model. Producible media types are determined from the resource classes Produces annotation.

In case a resource method is annotated with Template annotation then the return value of the method is the model. Otherwise the processing of such a method is the same as if the return type of the method was Viewable class. Producible media types are determined from the method's Produces annotation.

To see how templates are being resolved, see viewable.

Author:
Michal Gajdos
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The template name that should be used to output the entity.
  • Element Details

    • name

      String name
      The template name that should be used to output the entity. The template name may be declared as absolute template name if the name begins with a '/', otherwise the template name is declared as a relative template name.
      Default:
      ""