YUI 数据表在 IE 中无法处理大型数据集
我有一个数据表和数据源(YUI 2.6)。 XHRDataSource 连接到一个 XML 生成地址,该地址是一个 servlet,我在其中通过 PrintWriter 将 XML 写到响应上。
Servlet:
String data = dataProvider.fetch(request.getPathInfo());
int cLen = data.length();
response.getWriter().append(data);
response.setContentLength(cLen);
response.setContentType("text/xml");
response.getWriter().flush();
javascript:
var url = "../data/SomeProvider";
this.myDataSource = new YAHOO.util.XHRDataSource(url);
this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
this.myDataSource.connXhrMode = "queueRequests";
this.myDataSource.responseSchema = responseSchema;
this.myDataSource.maxCacheEntries = 0;
它在 FF3 中工作得很好。我可以通过 Firebug 看到返回的 xml,看起来不错;表和连接到数据源的其他所有内容都呈现良好。
在 IE8 中,它无法获取完整数据集(390 行……实际上没那么大),并且数据表声称未找到任何行。但是,如果我减小大小(也就是说,20-30 行),IE 就可以正常工作。我一直在高低搜索,但我没有想法——知道我错过了什么吗?
编辑 附加信息。当 XML 响应超过 8192 个字符标记时,即表示失败。据我所知,IE 在 URL 或参数字符串中限制了 8192 个字符 - 但为什么该限制适用于写入响应流本身的数据呢?或者 XMLHttpRequests 的处理方式是否不同?
I have a DataTable and DataSource (YUI 2.6). The XHRDataSource connects to an XML producing address which is a servlet, where I write the XML out onto the response via the PrintWriter.
Servlet:
String data = dataProvider.fetch(request.getPathInfo());
int cLen = data.length();
response.getWriter().append(data);
response.setContentLength(cLen);
response.setContentType("text/xml");
response.getWriter().flush();
javascript:
var url = "../data/SomeProvider";
this.myDataSource = new YAHOO.util.XHRDataSource(url);
this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
this.myDataSource.connXhrMode = "queueRequests";
this.myDataSource.responseSchema = responseSchema;
this.myDataSource.maxCacheEntries = 0;
It works in FF3 fine. I can see via Firebug the xml getting returned, it looks good; the table and everything else hooked to the data source render fine.
In IE8, it fails for the full dataset (390 rows .. not that big, really) and the data table claims no rows were found. However, if I reduce the size down (to say, 20-30 rows) IE works fine. I have been searching high and low but I'm out of ideas - any clue what I'm missing?
EDIT
Additional information. The failure is right when the XML response crosses the 8192 character mark. From what I've read, IE has a limit of 8192 characters in the URL or the parameter string - but why would that limit apply to data written into the response stream itself? Or do XMLHttpRequests get handled differently?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我明白了,但我不知道为什么会这样。
添加:
到 servlet 会让 IE 满意。我猜该参数默认为 8192 并且 IE 不要求流的其余部分?就像我说的,我不知道为什么它会起作用。这让我很紧张!
I figured it out, but I have no idea why it is so.
adding:
to the servlet makes IE happy. I guess that parameter defaults to 8192 and IE doesn't ask for the rest of the stream? Like I said, I don't know why it works. Which makes me nervous!