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

戏子无情 提交于 2019-12-06 22:23:22

Based on the information you provided, I would first look at the JSON response size. You mentioned that when the response is null the response time is short. Either make the AJAX request directly in the browser or use a debugging tool like Firebug (for Firefox) to see the response. It is possible that the response is really large and that the slowdown is in marshalling the Java object into a JSON response.

If the JSON response is really large and you don't need all of the information coming back, you may find it easier to create an object that contains only the fields you need and then marshall that.

Update

Okay, we can rule out the response being too large. Is there a reason that you have such a large list of excludeProperties? You might want to try commenting that out and see if it helps. Otherwise, perhaps its your server that is slow?

I replace jsonplugin with json-lib-2.3-jdk15.jar, and the problem has settled. Really appreciate your help~ So happy now O(∩_∩)O~

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!