用flexjson转换对象时,出错Error trying to deepSerialize
2014-09-02 12:07
302 查看
在序列化handler和hibernateLazyInitializer出错,
这两个应该 和hibernate的延迟加载有关, 在加上[java] view
plaincopyprint?
serializer.exclude(new String[]{"*.handler","*.hibernateLazyInitializer"})
后解决问题。
[java] view
plaincopyprint?
@Override
public String list()
{
QueryFilter filter = new QueryFilter(this.getRequest());
List list = this.ytMaterialService.getAll(filter);
StringBuffer buff = new StringBuffer("{success:true,'totalCounts':")
.append(filter.getPagingBean().getTotalItems()).append(
",result:");
JSONSerializer serializer = JsonUtil
.getJSONSerializer(new String[] {});
buff.append(serializer.exclude(new String[]{"*.handler","*.hibernateLazyInitializer"}).serialize(list));
buff.append("}");
this.jsonString = buff.toString();
System.out.println(new Date()+":YtMaterial——list()函数:" + this.jsonString);
return "success";
}
相关文章推荐
- 用flexjson转换对象时,出错Error trying to deepSerialize
- 用flexjson转换对象时,出错Error trying to deepSerialize
- XmlToJson-xml对象转换为Json对象类
- 特殊字符导致json字符串转换成json对象出错
- Theano 配置GPU出错:g++: error trying to exec 'cc1plus': No such file or directory
- 用表单格式化插件jquery.serializejson将表单上的数据转换成JSON对象
- json转换为对象,对象转换为json flexjson的灵活运用
- 将form表单里的数据封装成对象 json2.js的例子 jquery的serialize方法转换空格为+号的解决方法
- python中json对象转换出错解决方法
- 特殊字符导致json字符串转换成json对象出错
- Jackson转换对象为json的时候报java.lang.stackoverflowerror
- 关于ExtJs4提交数据到jsp页面,返回正确的json显示例子。及error:You're trying to decode an invalid JSON String...解决方法
- 特殊字符导致json字符串转换成json对象出错
- 编译出错提示 error trying to exec 'cc1': execvp: No such file or directory
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
- 使用JSON.parse将json字符串转换成json对象的时候会出错
- 使用JSON.parse将json字符串转换成json对象的时候会出错
- net.sf.ezmorph.bean.MorphDynaBean cannotbe cast to xxx 关于JSON对象解析List<XXX>在调用时出错问题
- 一个实用的 Javascript XML to JSON Object 对象的转换 (JQuery)
- sencha touch 通过.axhx获取后台数据时,Unable to parse the JSON returned by the server: Error: You're trying to