I need to serialize some objects to a JSON and send to a WebService. How can I do it using the org.json library? Or I\'ll have to use another one? Here is the class I need t
One can use the Jackson library as well.
Add Maven Dependency:
com.fasterxml.jackson.core jackson-core
Simply do this:
ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString( serializableObject );