HtmlDocSerializer

{@link oaj.html.HtmlDocSerializer} is an extension of {@link oaj.html.HtmlSerializer} that wraps serialized POJOs in a complete HTML document.

This class is used extensively in the creation of POJO-based user interfaces in the REST API.

Example:

/** * Sample REST resource that prints out a simple "Hello world!" message. */ @Rest( path="/helloWorld", htmldoc=@HtmlDoc( navlinks={ "up: request:/..", "options: servlet:/?method=OPTIONS" }, aside={ "<div style='max-width:400px' class='text'>", " <p>This page shows a resource that simply response with a 'Hello world!' message</p>", " <p>The POJO serialized is a simple String.</p>", "</div>" } ) ) public class HelloWorldResource extends BasicRestServlet {...}

The {@link oaj.html.HtmlDocSerializer#HTMLDOC_template HTMLDOC_template} setting defines a template for the HTML page being generated. The default template is described next.