yuwei5380 / jsonplugin

Automatically exported from code.google.com/p/jsonplugin
0 stars 0 forks source link

the server side string data return client side (ff) error , several chars lost. #103

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. one ajax request into an action 
2. return one field which value is in  "server side data.txt"
3. see the return value in the firefox firebug's network("网络")
which is in "client side data.txt"
so,error occured!

debug in JSONUtil.java :
            230
response.setContentLength(json.getBytes(serializationParams.getEncoding()).lengt
h);
           231
            PrintWriter out = response.getWriter();
           232
            out.print(json);  

we found that before 232,there is no error,and json string data is Correct。
but,the result client side received lost several chars。

I do not know where the problem is occured,i want to know is it  necessary
of the 230 row code.  

Original issue reported on code.google.com by zhuliyon...@163.com on 16 Apr 2010 at 9:58

GoogleCodeExporter commented 8 years ago
没有人处理这个问题?那个
response.setContentLength(json.getBytes(serializationParams.getEncoding()).lengt
h);
这句话可不可以删除的啊!经过测试返回的数据(可能是存��
�一些特殊的字符)总是会被截掉那
么一些,应该就是这个长度限制的问题,去掉之后就返回了��
�部的数据了,没有了问题。

Original comment by zhuliyon...@163.com on 21 Apr 2010 at 5:03