|
||||||||||
| 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 | |
|---|---|
java.lang.String |
name
The template name that should be used to output the entity. |
java.lang.Class<?> |
resolvingClass
The class to be used to resolve the template name if the template name is not absolute. |
public abstract java.lang.String name
public abstract java.lang.Class<?> resolvingClass
Object.class then the resolving class will be obtained from the last matching resource.
Defaults to Object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||