开发环境:easyui,ssh2
背景:category(类别表),account(管理员表),product(商品表),category many to one account,product many to one category
@Lazy="true"启动懒加载
今天做一个商品管理的模块,当我点击“商品管理”就是从后台查询product所有记录,如图
===================productServiceImp===================
===============================productAction===========================
然而productList是
原因是这里:
因为lazy="true",product级联category,category并没有查询account,所以json会注入一个$$_javassist的格式给account。*如果product与category级联的cid没有对应的数据,category也会出现$$_javassist,所以要细心。
====================解决方案============================
之前看了很多网上的解决方案{
1.Action里的getXXX()方法对json造成影响
2.添加@JSON(serialize=false)在getXXX()方法之上
}
其实,可以通过struts对json的过滤