Skip navigation links

Package org.glassfish.jersey.server.mvc

Provides support for Model, View and Controller (MVC).

See: Description

Package org.glassfish.jersey.server.mvc Description

Provides support for Model, View and Controller (MVC).

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 ofViewable 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.

Skip navigation links

Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.