@Inherited @Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) public @interface Template
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.
If a method is annotated with Template and also returning a Viewable instance then the values
(resolvingClass) from the viewable take precedence over those defined by the annotation.
Producible media types are determined from the method's Produces
annotation.
To see how templates are being resolved, see viewable.Viewable| Modifier and Type | Optional Element and Description |
|---|---|
String |
name
The template name that should be used to output the entity.
|
Class<?> |
resolvingClass
The class to be used to resolve the template name if the template name is not absolute.
|
public abstract String name
Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.