Class HtmlDocSerializer

All Implemented Interfaces:
AnnotationProvider, HtmlMetaProvider, XmlMetaProvider
Direct Known Subclasses:
HtmlSchemaDocSerializer

Serializes POJOs to HTTP responses as HTML documents.
Media types

Handles Accept types: text/html

Produces Content-Type types: text/html

Description

Same as HtmlSerializer, except wraps the response in <html>, <head>, and <body> tags so that it can be rendered in a browser.

Configurable properties are typically specified via @HtmlDocConfig.

Example:

@Rest( messages="nls/AddressBookResource", title="$L{title}", description="$L{description}" ) @HtmlDocConfig( navlinks={ "api: servlet:/api", "doc: doc" } ) public class AddressBookResource extends BasicRestServlet {

The $L{...} variable represent localized strings pulled from the resource bundle identified by the messages annotation.
These variables are replaced at runtime based on the HTTP request locale.
Several built-in runtime variable types are defined, and the API can be extended to include user-defined variables.

Notes:
  • This class is thread safe and reusable.
See Also: