How to convert a bean to JSON using JSON-LIB

2.7k views Asked by At

Cn anyone show a example of generating a JSOn from a bean class using JSON-LIB? I am not able to find a example to understand this.

Thanks

1

There are 1 answers

2
Pablo Santa Cruz On

How about?

MyBean mb = new MyBean();
JSON json = JSONObject.fromObject(mb);