0

keep-across-visits keep-across-visits doesn't work

asked 2010-12-02 04:35:57 +0800

guisimon gravatar image guisimon
217 7
http://www.artsys.fr

Hello Zk team,

I have some questions about the keep-across-visits configuration in zk.xml.
I put some parameters in the desktop Object during the user navigation and i would like to retrieve this parameter when user refresh the pages. I put this values in the attributes of the desktop.

my zk.xml

<!-- keep the desktop when a user reloads an URL or browses away to another 
		URL -->
	<client-config>
		<keep-across-visits>true</keep-across-visits>
	</client-config>

	<session-config>
		<max-desktops-per-session>1</max-desktops-per-session>
		<!-- 0 disabled server push -->
		<max-pushes-per-session>0</max-pushes-per-session>
	</session-config>

I try to put the zkmax desktopRecycle listener in zk.xml but it doesn't work too.
I use maven2 and ZkEE eval with zk 5.0.5

Is It a bug or a misunderstanding ?

thanks for all
regards

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2010-12-05 22:36:26 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,

If the keep-across-visits is true, the desktop won't remove anymore, so the setting of Reuse Desktops won't work because it cannot find any desktop that should be removed.

link publish delete flag offensive edit

answered 2010-12-06 00:27:29 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

The document about keep-across-visits is enhanced. Please refer to ZK Configuration Reference.

link publish delete flag offensive edit

answered 2010-12-06 03:50:36 +0800

guisimon gravatar image guisimon
217 7
http://www.artsys.fr

Hi tomyeh and jumperchen

i set keep-across-visits to true but when i refresh the page, I think the desktop is removed because all the attributes are removed and the id of the desktop has changed.

so is it a configuration problem or a bug in version 5 ?


thanks

link publish delete flag offensive edit

answered 2010-12-06 05:42:11 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

updated 2010-12-06 05:56:10 +0800

No, not a bug.

Each time you reload a page, a new desktop will be created to serve the request. It is what the reload means, isn't it? Since a new desktop is created to serve the request, the previous desktop can be removed. Thus, ZK will send another request (Ajax) to the server to notice the server, when reloading (and eventually remove the desktop at the server for saving memory).

On the other hand, keep-across-visits only turned off the removal of the desktop, so you rarely need to do it (as mentioned in the documentation).

For retrieving the desktop, keep-across-visits is NOT what you want (and you shall not turn it on; otherwise, the server won't know the desktop shall be removed). Rather, you shall use DesktopRecycle. However, be aware that the desktop reuse usually takes place in the SECOND refresh. Why? As described above, the refresh will send two request: one is the same URL shown on the browser window, and the other is the ajax request for removing desktop. Unfortunately, the browser's URL usually arrives before the removing-desktop request. It means, in the first refresh, the server doesn't know the previous desktop shall be dead (and can be resused). And, only the second refresh, the server knows the very first desktop is dead and reuse it.

With the current implementation of browsers, I'm afraid you cannot get what you want (single deskop per session per request), unless you extend DHtmlLayoutServlet to do the trick -- but it is kind of experiments then.

link publish delete flag offensive edit
Your reply
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

Follow

RSS

Stats

Asked: 2010-12-02 04:35:57 +0800

Seen: 254 times

Last updated: Dec 06 '10

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