Open GoogleCodeExporter opened 8 years ago
after some test i found reason:
gson do not have method convert JsonElement to JSONString;
JsonElement.toString() not proccess \n \t .... special chars
my solution:
patch google-gson-1.3:
public void toJson(Object src, Type typeOfSrc, Appendable writer) {
try {
if (src != null) {
JsonSerializationContext context = new JsonSerializationContextDefault(
createDefaultObjectNavigatorFactory(), serializeNulls, serializers);
JsonElement jsonElement = null;
if(src instanceof JsonElement){
jsonElement = (JsonElement)src;
}else{
jsonElement = context.serialize(src, typeOfSrc);
}
....
patch jngine:
public class JsonRequestProcessor extends RequestProcessorBase
where: a instance JsonElement call toString()
change to getGson.toJson(JsonElement)
Original comment by lxb...@gmail.com
on 9 Sep 2009 at 12:02
Original issue reported on code.google.com by
lxb...@gmail.com
on 9 Sep 2009 at 8:42