JSONArray 報錯: NoSuchMethodException: Property 'delegate' has no getter method

   當咱們配置完OpenSessionInViewFilter,或者把轉換對象爲json字串的操做放到了事務裏面之後,仍然報錯 :java.lang.NoSuchMethodException: Property 'delegate' has no getter method  .java

一種解決方案:json


JsonConfig config = new JsonConfig();ide

config.setExcludes(new String[]{"one2many的字段集合名稱", "hibernateLazyInitializer","handler","tProvince"});spa

JSONArray jsonArray = JSONArray.fromObject(dao.getAll(rowStartIdxAndCount),config);hibernate

return jsonArray.toString();對象

相關文章
相關標籤/搜索