服务器连接因 ICEFaces 长请求而消失
我有很长的 HTTP 请求(生成大型 Excel 文件 - 大约 60K 记录左右),大约需要 5 分钟才能完成。 带icefaces的轮子显示连接已死,尽管文件已在服务器上准备就绪,但ICEFaces页面已死,我必须刷新它,但无法获取文件! 如何延长超时 我在 web.xml 中尝试了以下操作,但没有帮助:
代码 - Web.xml:
.....
<context-param>
<param-name>blockingConnectionTimeout</param-name>
<param-value>600000</param-value>
</context-param>
<context-param>
<param-name>synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>connectionTimeout</param-name>
<param-value>600000</param-value>
</context-param>
<context-param>
<param-name>heartbeatRetries</param-name>
<param-value>20</param-value>
</context-param>
<context-param>
<param-name>heartbeatInterval</param-name>
<param-value>400000</param-value>
</context-param>
<context-param>
<param-name>heartbeatTimeout</param-name>
<param-value>2000000</param-value>
</context-param>
.....
有什么想法吗?
谢谢,
谭
I have long HTTP request ( generating large Excel file - about 60K records or so) which takes like 5 minutes to complete. The wheel with icefaces shows connection is dead and although the file is ready on the server, ICEFaces page is dead and I have to refresh it and can't get the file! How to about extending timeout I tried the following in web.xml but it didn't help:
Code - Web.xml:
.....
<context-param>
<param-name>blockingConnectionTimeout</param-name>
<param-value>600000</param-value>
</context-param>
<context-param>
<param-name>synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>connectionTimeout</param-name>
<param-value>600000</param-value>
</context-param>
<context-param>
<param-name>heartbeatRetries</param-name>
<param-value>20</param-value>
</context-param>
<context-param>
<param-name>heartbeatInterval</param-name>
<param-value>400000</param-value>
</context-param>
<context-param>
<param-name>heartbeatTimeout</param-name>
<param-value>2000000</param-value>
</context-param>
.....
Any ideas?
Thanks,
Tam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在不了解更多问题的情况下,我将采取以下方法:
用户单击链接以生成 Excel 文件。 显示一些消息来代替链接,例如“正在处理...”
定期(可能每 3 秒)询问服务器是否已生成文件,如果没有生成,请等待几秒钟并再次询问。
文件生成完成后,将“正在处理...”文本更改为指向“下载 yourfile.xls”文件的链接,该文件已生成并存储在服务器的下载区域中。
这样浏览器就不会卡在等待文件生成的过程中。
Without knowing more about the problem, here's the approach I would take:
User clicks on link to generate excel file. Display some message in place of the link such as "Processing..."
Periodically (maybe every 3 sec) ask the server if the file has been generated, if not wait a few seconds and ask again.
Once the file is finished generating, change the "Processing..." text to a link to the file "Download yourfile.xls" which has been generated and stored on the server in a download area.
This way the browser isn't stuck waiting for the file to be generated.
好像是客户端超时了!
尝试使用 ajax 响应进行异步创建。
Seems to be a client timeout!
Try async creation with ajax response.
尝试将缓冲区大小设置为更大的值,以防止客户端/服务器之间不必要的握手。
web.xml
您会发现人们通过这个小开关大幅提高了 JSF 性能,并提供了很多积极的反馈。
也许这对你的情况也有帮助?
Try setting the buffer size to an increased value to prevent unneccessary handshaking between client/server.
web.xml
You'll find a lot of positive feedback from people who increased their JSF performance drastically with this little switch.
Maybe it will help in your situation, too?