In daily use, we usually encounter map to JSON, if the traversal will waste a lot of time, in fact, we have such a jar package
Copy Code code as follows:
The method * * * is undefined which package is missing for the type jsonobject------
Json-lib.jar
It's still not going to work. Need a dependent jar package or you'll get an error.
Copy Code code as follows:
Java.lang.ClassNotFoundException:net.sf.ezmorph.Morpher
When when the jar package is Ezmorph-***.jar
The following methods we use are
Jsonserializer.tojson (Map Object)
For example, our map object is
Copy Code code as follows:
{TIME=2015/04/10, carnum= A2212, mark= front bumper damaged, headlights damaged, billnum=100232113213r}
The result of converting to JSON is
Copy Code code as follows:
{"Time": "2015/04/10", "Carnum": "Jing A2212", "Mark": "Front bumper damaged, headlamps damaged", "Billnum": "100232113213R"}
Is it a super love