Tag: json

The wcf:json tag converts a specified Java object to JavaScript Object Notation (JSON).

Tag information
Body Content empty


Attributes

Attribute Required Request-time Type Description
object true true java.lang.Object The Java object that is to be converted to JSON.

If the specified object is a Java boolean, number, string, date, character, class, or throwable class object, the tag json converts the object to a string by calling the toString() method of the tag. The resulting object is URL encoded. If the object is an SDO data object, the object is parsed and a structured JSON document is created.


Variables

No variables are defined for the wcf:json tag.


Limitations

  1. The wcf:json tag operates on Java objects, not Java primitives.

  2. It cannot convert objects that reference themselves. That is, if an object references itself, a stack overflow error occurs.


Example

The following example converts the RequestProperties object into JSON notation:


Related reference
WebSphere Commerce foundation tag library