zkau servlet last execution detection

asked 2013-05-24 14:09:01 +0800

cocoes gravatar image cocoes flag of Spain
94 6


in order to control when to update the client interface faster or slower depending when was the last time that the client browser asked for changes through "zkau" servlet, Is there any way to know from the Desktop or the Page Composer when was the last time the client asked for updates?

I know you can configure the min, max and ratio in zk.xml, but in my application is interesting to know it due to it's architecture.



delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-06-28 03:34:50 +0800

benbai gravatar image benbai
2228 6

updated 2013-06-28 03:35:11 +0800

You can implement EventInterceptor (refer to Performance Monitoring/Event Interceptors and EventInterceptor) or use a filter to detect zkau request then put the time into session and try to get it from Composer.



link publish delete flag offensive edit


Hi Ben,many thanks

cocoes ( 2013-07-01 11:22:52 +0800 )edit

answered 2013-07-01 11:37:11 +0800

cocoes gravatar image cocoes flag of Spain
94 6

Hi Ben,many thanks.

I've used a filter because it fits better with our development, the eventinterceptor produced thousands of events .

In the Thread I've added:


to compare with the current time, and stop the thread whenever the difference is great enough.

But now I've seen that the browser keeps requesting "zkau" servlet until the end of the world, and I'll like to stop it after a server not answers during some time.

Do you know if there's any response code to say to the ZK javascript client to stop asking to the server , if it has been more than X seconds asking (I'll put it in the servlet filter), like this:


I've done some tests and after a two minutes browser disconnections , the ZK client browser sends several "zkau" requests at the same second.

Many thankx,


link publish delete flag offensive edit



Is there any timer, server push or keep-alive setting (refer to http://books.zkoss.org/wiki/ZK%20Configuration%20Reference/zk.xml/The%20session-config%20Element ) ? You can try to remove timer/server push and set timer-keep-alive to false to confirm the cause.

benbai ( 2013-07-01 14:40:54 +0800 )edit

Hi again Ben. I'll use the session-config/session-timeout element instead, together with the session's getLastAccessedTime(). By the way, the session-timeout does not times-out as expected, it takes a aleatory time to disconnect as said here: http://forum.zkoss.org/question/77589/session-timeout-pro

cocoes ( 2013-07-01 15:50:50 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2013-05-24 14:09:01 +0800

Seen: 25 times

Last updated: Jul 01 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More