Вопрос

I am using out.flush() in a jsp to update regularly the results of some execution in the browser. It is a long execution, about 10 minutes, and I don't want the browser to look like it is waiting forever. (It also avoids timeout errors).

It works fine, when connecting directly to tomcat port, but when I go through an apache web server it is not working (it is probably because the flush now is sent to the web server and the web server doesn't flush until some buffer is filled).

Any idea how could I achieve the same result I was having connecting to tomcat port, but going throufh a web server?

I'm looking for a simple solution (if possible), I mean not ajax or launching a new thread in tomcat and then refreshing the browser regularly, as they will imply a lot of changes.

thanks in advance.

Это было полезно?

Решение

There's a configuration parameter in the mod_jk plugin that addresses this problem.

The option is : JkOptions +FlushPackets

Having this option set, Apache web server will flush anything that it receives from Tomcat.

Другие советы

Increase the Apache timeout to 10min?

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 600
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top