{title:'HtmlDocSerializer', updated:'9.0.0'}

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

The class hierarchy for the builder of this serializer is:

- {@link oaj.Context.Builder}
  - {@link oaj.BeanContextable.Builder}
    - {@link oaj.BeanTraverseContext.Builder}
      - {@link oaj.serializer.Serializer.Builder}
        - {@link oaj.serializer.WriterSerializer.Builder}
          - {@link oaj.xml.XmlSerializer.Builder}
            - {@link oaj.html.HtmlSerializer.Builder}
              - {@link oaj.html.HtmlStrippedDocSerializer.Builder}
                - {@link oaj.html.HtmlDocSerializer.Builder}

Refer to the builder javadocs for configurable settings.

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") | @HtmlDocConfig( | 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 implements BasicUniversalConfig {...}

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