0

how to catch applet client exception

asked 2014-01-13 17:52:49 +0800

apam gravatar image apam
24 1

Hi, I have problem with an applet, sometime users, due to continuos java and brower updates and securety restriction, fail to check security alert and the applet does not load.

When this happen I get an

SEVERE: [Desktop zmd:/authriv/menu.zul] client error: Method not found: findPrinter on log file and a zkoss popup error with "method not found: findPrinter" because the applet class isn't loaded due to some browser or java restriction

I call the applet method on server side in this way: applet.invoke("findPrinter", "HPxxx");

Is there a way to catch this exception in my code ? Is there a way to undestand if the applet class il loaded on server side ?

thank you giuseppe

delete flag offensive retag edit

7 Answers

Sort by ยป oldest newest most voted
0

answered 2014-01-14 07:27:17 +0800

apam gravatar image apam
24 1

Hi, thank you for you reply I tried to catch the exception server side in the way you show me but the excepion is catched by zk before ( I tried again just few minutes ago ) and never passed to my code

gen 14, 2014 8:17:36 AM org.zkoss.zk.ui.impl.DesktopImpl service:721 SEVERE: [Desktop z_4bu:/authriv/menu.zul] client error: Method not found: findPrinter

link publish delete flag offensive edit

Comments

oke I'll look in to it. but can you give full stacktrace? and what version (for the correct class of zk

chillworld ( 2014-01-14 07:35:04 +0800 )edit

You are sure that you have the method findPrinter and your path to your applet is correct? (this is not really a problem that could work sometimes and sometimes not)

chillworld ( 2014-01-14 07:41:03 +0800 )edit
0

answered 2014-01-14 08:53:09 +0800

apam gravatar image apam
24 1

The applet works fine if do not block it ( user can block applet if press wrong button in security popup ) When apple is blocked, applet class is not loaded and if I try to use a method, like "findPrinter", zk rise an axception. It's correct and I just want to catch this situation and inform user about this problem instead of view zk popup exception For this project I'm using zk 6.0.2 I tried to use zk.xml error page element (http://books.zkoss.org/wiki/ZK%20Configuration%20Reference/zk.xml/The%20error-page%20Element ) but without success

link publish delete flag offensive edit
0

answered 2014-01-14 10:48:12 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Oke I searched a little further. In zk 7.0 (don't know older versions) we have this :

if (applet.isMayscript()){
    applet.invoke("findPrinter", "HPxxx");
} else {
    //do your code
}

Can you try this?

link publish delete flag offensive edit
0

answered 2014-01-14 14:35:44 +0800

apam gravatar image apam
24 1

Sorry, I did a mistake while testing isMayscript(). It return always False even if the applet is correctly loaded giuseppe

link publish delete flag offensive edit

Comments

oke, I'll search further. Sorry that I have to ask you to try things but that is that I can't test your code myself. (I delete mine post cause its wrong, maybe you can clean also a little

chillworld ( 2014-01-14 14:41:27 +0800 )edit
0

answered 2014-01-14 13:55:49 +0800

apam gravatar image apam
24 1

wow!! seems to work

I do not understand why but I'll study the documentation isMayscript works 6.0.2 too Thanks a lot

Giuseppe

link publish delete flag offensive edit
0

answered 2014-01-14 14:38:40 +0800

apam gravatar image apam
24 1

Sorry, I did a mistake while testing isMayscript function. It return always False even if the applet is corrctly loaded :(

giuseppe

link publish delete flag offensive edit
0

answered 2014-01-16 20:16:36 +0800

chioannou gravatar image chioannou
0

I dont think that anything in the zk's Applet class will help you to catch it. I have the same problem with an applet that i use for printing and i couldnt find a solution. One hard approach is to call a url with the session id from the applet and inform the server that the applet is loaded and unblock the findPrinter(). I will try if i can intercept ZK's messages first.

link publish delete flag offensive edit

Comments

thak you.

apam ( 2014-01-17 13:35:34 +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

Follow
1 follower

RSS

Stats

Asked: 2014-01-13 17:52:49 +0800

Seen: 22 times

Last updated: Jan 16 '14

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