-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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.
The document about keep-across-visits is enhanced. Please refer to ZK Configuration Reference.
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
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.
Asked: 2010-12-02 04:35:57 +0800
Seen: 254 times
Last updated: Dec 06 '10