See: Description
Class | Description |
---|---|
Viewable |
A viewable type referencing a template by name and a model to be passed
to the template.
|
Annotation Type | Description |
---|---|
ImplicitProduces |
Defines the media type(s) that a resource class can produce for
implicit views.
|
Given the MVC pattern the Controller corresponds to a resource class, the View to a template referenced by a template name, and the Model to a Java object (or a Java bean).
A resource method of a resource class may return an instance of
Viewable
that encapsulates the template name
and the model. In this respect the instance of
Viewable
is the response entity. Such a
viewable response entity may be set in contexts other than a resource
method but for the purposes of this section the focus is on resource methods.
The Viewable
, returned by a resource method,
will be processed such that the template name is resolved to a template
reference that identifies a template capable of being processed by an
appropriate view processor.
The view processor then processes template given the model to produce a
response entity that is returned to the client.
For example, the template name could reference a Java Server Page (JSP) and the model will be accessible to that JSP. The JSP view processor will process the JSP resulting in an HTML document that is returned as the response entity. (See later for more details.)
Two forms of returning Viewable
instances
are supported: explicit; and implicit.
Copyright © 2016 Oracle Corporation. All Rights Reserved.