i want to send json data to my page , here is the code :
response.setContentType("application/json");
String jsonObject = "{ key1 = value1, key2 = value2 }";
JSON json = JSONSerializer.toJSON(jsonObject);
PrintWriter out = response.getWriter();
out.print(json);
out.flush();
return null;
i get this error :
java.lang.NoClassDefFoundError: net/sf/json/JSONSerializer
i'm using jdk1.7 and json : -json-lib-2.4-jdk15.jar -json-lib-2.4-jdk15-javadoc.jar -json-lib-2.4-jdk15-sources.jar
ezmorph : -ezmorph-1.0.6.jar
and commons-lang.jar
why i'm getting this error ?