prilia / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Example 6-1 - Customize JSON outputs #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hallo I try example 6.1 but i get: [User@a4edc4,User@1f5eb7f,User@381a53] 
 where is the problem ?  

Original issue reported on code.google.com by xxxxma...@gmail.com on 22 Apr 2009 at 8:41

GoogleCodeExporter commented 9 years ago
Make sure your User class implement JSONAware:

class User implements JSONAware{
  ...
}

Original comment by fangyid...@gmail.com on 23 Apr 2009 at 4:10

GoogleCodeExporter commented 9 years ago
Yes I create interface JSONAware in same package and implement JSONAware. Look 
at my
code : http://stargate.cnl.tuke.sk/~maly/simple

Original comment by xxxxma...@gmail.com on 23 Apr 2009 at 6:14

GoogleCodeExporter commented 9 years ago
I looked into your code. You should do 2 things below:
1. Use JSONAware(org.json.simple.JSONAware) from JSON.simple instead of 
creating your
own;

2. class User should implement org.json.simple.JSONAware:
class User implements org.json.simple.JSONAware {
  ...
}

Original comment by fangyid...@gmail.com on 23 Apr 2009 at 10:04

GoogleCodeExporter commented 9 years ago
Ok, I pass interface org.json.simple.JSONAware into package org.json.simple.* 
but
error always exist. I am dispairing. I give on server test web app which 
content only
this trouble> http://stargate.cnl.tuke.sk/~maly/jquery_1/  

Original comment by xxxxma...@gmail.com on 23 Apr 2009 at 6:13

GoogleCodeExporter commented 9 years ago
Your resultJ.java looks good. Please make sure the compiled resultJ.class is up 
to
date and no old version is cached in you app classpath.

Original comment by fangyid...@gmail.com on 27 Apr 2009 at 4:42

GoogleCodeExporter commented 9 years ago

Original comment by fangyid...@gmail.com on 28 Apr 2009 at 2:59