HTML Methodology
This page describes how the different POJO datatypes are represented in HTML. The representations mirror how the same data structures are represented in JSON, and build directly on the XML Methodology:
- Simple values (strings, numbers, booleans, nulls) render as text, with lightweight type tags added only where the datatype cannot be inferred through reflection.
Mapsand beans render as<table>elements.Collectionsand arrays render as<ul>bulleted lists.
The examples below show one representative case per category.
For the complete set of data-type representations (all Map, array, Collection, and bean shapes), see the reference tables on the HTML Serializers page.
Simple types
The representation for simple types mirrors those produced by the XML serializer. Tags are added to help differentiate data types when they cannot be inferred through reflection. These tags are ignored by browsers and treated as plain text.
| Data type | JSON example | HTML |
|---|---|---|
| string | | |
| boolean | | |
| integer | | |
| float | | |
| null | | |
Objects
Maps and beans are represented as tables.
The _type='object' attribute distinguishes objects (Maps/beans) from arrays (arrays/Collections), and per-cell type tags are added only where the value type cannot be inferred through reflection.
The following representative example shows a bean containing simple values, a nested bean, and array properties:
| Data type | JSON example | HTML |
|---|---|---|
| | |
Arrays and collections
Collections and arrays are represented as <ul> ordered lists, with type tags added to individual <li> elements as needed.
Collections (e.g. List, Set) serialize identically to their array equivalents.
The following representative example shows a mixed-type Object[]:
| Data type | JSON example | HTML |
|---|---|---|
| Object[] | | |