0

Browser refresh on click of ZK component in page after clicking browser back button

asked 2013-05-30 02:28:09 +0800

RichardL gravatar image RichardL
768 4

updated 2013-05-31 02:07:12 +0800

vincentjian gravatar image vincentjian
2245 6

Hi all, I've had a look around the forums but couldn't find an answer. This is a simple question, so hopefully there's a simple fix.

In my webapp I have zul files included in jsp files,like this:

<jsp:include page="/include/zul/top-win.zul" />

The problem is if I click the "Back" browser button and then click on any ZK component (including native ones) the browser page refreshes. I assumed this is a browser cache issue, so I put this in the head of my jsp:

<meta http-equiv="Cache-Control" content="no-cache, no-store, max-age=0, must-revalidate" />
<meta http-equiv="Expires" content="Fri, 01 Jan 2010 00:00:00 GMT" />

But it had no effect - the page still refreshes when a component is clicked. This doesn't happen if I click anything else in the jsp - only the ZK components.

What can I do about this?

Thanks!

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-06-03 03:49:16 +0800

RichardL gravatar image RichardL
768 4

updated 2013-06-03 05:47:10 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I found the issue. I had this in my servlet:

// tell ZK to drop desktops once the user navigates to other URL

request.setAttribute(org.zkoss.zk.ui.sys.Attributes.NO_CACHE,
                    Boolean.TRUE);

After taking this out, it works as expected. I think I got this line of code from the performance tips.

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

Follow
1 follower

RSS

Stats

Asked: 2013-05-30 02:28:09 +0800

Seen: 47 times

Last updated: Jun 03 '13

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