string convert json object code example
Example 1: convert json to object
Jackson Data-bind depdendency that take care of
Converting between
JSON to Java Object
and
Java Object to JSON
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
</dependency>
Example 2: change to json string
var obj =
{ name: "John", today: new Date(), city : "New York" };
var myJSON = JSON.stringify(obj);
document.getElementById("demo").innerHTML = myJSON;