0

DesktopCleanup is not called in IE 9

asked 2015-03-11 07:16:29 +0800

gds1987 gravatar image gds1987
18

Hi, all, I have encountered one interesting question about "DesktopCleanup"

There are two ways to do something after closing the browser:

public class MyDesktopCleanup implements DesktopCleanup {
    public void cleanup(Desktop arg0) throws Exception {
     System.out.println("Close browser======");
    }
 }

 zk.xml: listener description: MyDesktopCleanup listener-class com.text.MyDesktopCleanup

or, you can do this: ===============

@Override
public void doAfterCompose(Component comp) throws Exception {
    // TODO Auto-generated method stub
    super.doAfterCompose(comp); 

    comp.getDesktop().addListener(new DesktopCleanup() {            
        public void cleanup(Desktop desktop) throws Exception {                                             
            System.out.println("Close browser======");              
        }
    });     
}

I have test these two methods in Chrome and firefox, they both operated well and print :"Close browser======". But if I run this in IE 9, something interesting happened: after running the web project and I open IE 9 to access the web page. Before closing IE, I do nothing, then the DesktopCleanup is called and it is right. However, if I do something like upload files on web page, after closing IE, the DesktopCleanup would be not called.

So, how can I resolve this problem ? Thank you very much!

delete flag offensive retag edit
Be the first one to answer this question!
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: 2015-03-11 07:16:29 +0800

Seen: 6 times

Last updated: Mar 11 '15

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