服务器连接因 ICEFaces 长请求而消失

发布于 2024-07-26 10:53:33 字数 1268 浏览 2 评论 0原文

我有很长的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

痴骨ら 2024-08-02 10:53:34

在不了解更多问题的情况下,我将采取以下方法:

  1. 用户单击链接以生成 Excel 文件。 显示一些消息来代替链接,例如“正在处理...”

  2. 定期(可能每 3 秒)询问服务器是否已生成文件,如果没有生成,请等待几秒钟并再次询问。

  3. 文件生成完成后,将“正在处理...”文本更改为指向“下载 yourfile.xls”文件的链接,该文件已生成并存储在服务器的下载区域中。

这样浏览器就不会卡在等待文件生成的过程中。

Without knowing more about the problem, here's the approach I would take:

  1. User clicks on link to generate excel file. Display some message in place of the link such as "Processing..."

  2. Periodically (maybe every 3 sec) ask the server if the file has been generated, if not wait a few seconds and ask again.

  3. 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.

自找没趣 2024-08-02 10:53:33

好像是客户端超时了!
尝试使用 ajax 响应进行异步创建。

Seems to be a client timeout!
Try async creation with ajax response.

不再见 2024-08-02 10:53:33

尝试将缓冲区大小设置为更大的值,以防止客户端/服务器之间不必要的握手。

<context-param> 
  <param-name>facelets.BUFFER_SIZE</param-name>
  <param-value>500000</param-value>
</context-param>

web.xml

您会发现人们通过这个小开关大幅提高了 JSF 性能,并提供了很多积极的反馈。
也许这对你的情况也有帮助?

Try setting the buffer size to an increased value to prevent unneccessary handshaking between client/server.

<context-param> 
  <param-name>facelets.BUFFER_SIZE</param-name>
  <param-value>500000</param-value>
</context-param>

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文