|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Inherited
@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
public @interface TemplateUsed to annotate JAX-RS resources and resource methods to provide reference to a template for MVC support.
In case a resource class is annotated withTemplate 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| Optional Element Summary | |
|---|---|
String |
name
The template name that should be used to output the entity. |
Class<?> |
resolvingClass
Deprecated. This attribute is obsolete and will be removed in the future releases. There is no replacement. |
public abstract String name
@Deprecated public abstract Class<?> resolvingClass
Object.class then the resolving class will be obtained from the last matched resource.
Defaults to Object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||