jsonplugin

Struts2 JSON Plugin not working with “lazy” data

筅森魡賤 提交于 2019-12-13 04:35:47
问题 I have an Entity with a OneToOne relation that is fetched lazily: @Entity public class Person { @Id private Integer id; @Column(length=60) private String address; @OneToOne(fetch=FetchType.LAZY) @JoinColumn(name="idProvince") private Province province; } This is the test I do, trying to get all the entities and to serialize them as JSON, using the JSONUtil class in JSONPlugin (the 'official' json plugin for Struts 2): List<Person> people = personService.findAll(); String result = JSONUtil

Struts2+jsonplugin: response takes a long time to display in browser from remote server

别说谁变了你拦得住时间么 提交于 2019-12-08 05:07:50
问题 Sending request to action using Ajax, the result type is json. Use a json plugin for struts2. The result is correct, but takes a very long time. Below is the content of struts.xml: <package name="FoodCompositionSearchajax" extends="json-default"> <action name="addSearchCondition" class ="com.fmOnline.action.FmzxMenuCompositionSearchAction" enter code here method="addSearchCondition"> <result name="success" type="json"> <param name="excludeProperties"> showList\[\d+\]\.foodStr,showList\[\d+\]\

Struts2+jsonplugin: response takes a long time to display in browser from remote server

戏子无情 提交于 2019-12-06 22:23:22
Sending request to action using Ajax, the result type is json. Use a json plugin for struts2. The result is correct, but takes a very long time. Below is the content of struts.xml: <package name="FoodCompositionSearchajax" extends="json-default"> <action name="addSearchCondition" class ="com.fmOnline.action.FmzxMenuCompositionSearchAction" enter code here method="addSearchCondition"> <result name="success" type="json"> <param name="excludeProperties"> showList\[\d+\]\.foodStr,showList\[\d+\]\.nourishStr, showList\[\d+\]\.searchFunction,showList\[\d+\]\.num1, showList\[\d+\]\.num2,showList\[\d+

Struts2+jsonplugin: response takes a long time to display in browser from remote server

∥☆過路亽.° 提交于 2019-12-06 22:21:24
Sending request to action using Ajax, the result type is json. Use a json plugin for struts2. The result is correct, but takes a very long time. Below is the content of struts.xml: <package name="FoodCompositionSearchajax" extends="json-default"> <action name="addSearchCondition" class ="com.fmOnline.action.FmzxMenuCompositionSearchAction" enter code here method="addSearchCondition"> <result name="success" type="json"> <param name="excludeProperties"> showList\[\d+\]\.foodStr,showList\[\d+\]\.nourishStr, showList\[\d+\]\.searchFunction,showList\[\d+\]\.num1, showList\[\d+\]\.num2,showList\[\d+

struts2.0和jQuery1.5的json问题

允我心安 提交于 2019-12-03 02:57:42
项目中通过jsonplugin-0.21.jar做json和struts2的整合。前台用jQuery1.5。 调用jquery的ajax方法时,总是出现“parsererror”错误。 在ajax的error回调中弹出异常信息。 error: function(XMLHttpRequest, textStatus, errorThrown) { alert( errorThrown); }, 发现返回的json串中,对于实体类的转换有问题,类名转换后的键值对没有用双引号, 而是这样:{__cp:'com.dw.web.vo.User',"name":"tom","sex":"male",....}, 后来查到jQuery1.4版本以后,对json串的解析更加严格,如果没有用双引号,就会出现转换错误。 然后就感觉可能是jsonplugin-0.21.jar包的问题, 从官方下载了一个jsonplugin-0.32.jar,替换后问题解决。 来源: oschina 链接: https://my.oschina.net/u/100569/blog/29380