0

Zk and Siteminder - Catch Client Error

asked 2012-03-09 10:26:34 +0800

emiweb gravatar image emiweb
12 1

Hi, I have a problem with my Zk web application. It uses Siteminder for session management.
In detail, when the browser sends a request on XHR channel and the session (Siteminder) goes in timeout,
the Siteminder web Agent returns an HTML page and there is the following error message:

The server is temporarily out of service. Would you like to try again?
(unexpected token < (syntaxError))

If I refresh the browser (pressing F5) the page is properly displayed.
Is it possible to catch the client errors and to manage as well ?
Thanks

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2012-03-12 14:08:16 +0800

emiweb gravatar image emiweb
12 1

updated 2013-01-22 05:10:37 +0800

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

Hi, I'm tried using window.onerror but it seems not work in zul page. I used different ways to do this.

<n:script xmlns:n="native">
window.onerror = function noError(){
        alert("I'm here");
                          return true;
                        };
</n:script>

I'm tried in <zscript language="javascript"> block also. Perhaps window.onerror is overwritten by the ZK engine?

link publish delete flag offensive edit

answered 2012-03-13 09:54:03 +0800

emiweb gravatar image emiweb
12 1

updated 2013-01-22 05:11:45 +0800

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

Hi, the other evets of object windos work fine, in fact:

<n:script xmlns:n="native">
alert("Alert!");
window.alert("ALERT");


window.onload = function noLoad(){
        alert("onLOAD work!!!!!");
        return true;
        };

window.onblur = function noBlur(){
        alert("onBLUR work!!!!!");
                          return true;
        };


window.onerror = function noError(){
        alert("onERROR work!!!!!");
        return true;
        };

</n:script>

I see all the alert except onError... why does this happen?

link publish delete flag offensive edit

answered 2013-01-18 21:36:35 +0800

rickcr gravatar image rickcr
704 7

I have a similar situation that I urgently need to address. If the user leaves the application open (and sayputs their computer to sleep) and then comes back later, after siteminder's session has timed out, and clicks something within our zk application, a siteminder html response is returned which of course breaks the ajax call and the user is stuck in a javascript alert they can not break out of by simply hitting "ok" (User has to know to refresh the page.)

I need to somehow capture what is happening via javascript and refresh the browser so that siteminder and return the proper company portal login page.

How do I best achieve this? or some other work arounds? We can't be the only one that runs into this problem?

link publish delete flag offensive edit

answered 2013-01-21 22:24:21 +0800

rickcr gravatar image rickcr
704 7

We really have to solve this issue. Nobody else ever runs into this?

Isn't the error passed on to the underlying page somehow so I could at least trap it and then redirect to the home page which would ultimately result in my hitting the company login page (which is what I want.) At the moment, I'm stuck since the siteminder time out response is trying to be handled by ZK's javascript. (It can't even reach our own timeout page since of course siteminder is capturing the request first.)

link publish delete flag offensive edit

answered 2013-01-22 16:36:35 +0800

rickcr gravatar image rickcr
704 7

@ jj But how would I access this hook? ZK's javascript is the one that first handles the ajax response, so I'm not sure how to hook into it? I could sort of see where it's trapped using Chrome's Developer Tools but it's condensed javascript and doesn't look it's meant to be overwritten/modified by users of ZK.

If at the very least, if I had some way to handle a javascript error in a generic sense on my main layout page and simply redirect at that point, things would be fine, but based on the thread above capturing onerror isn't easy?

link publish delete flag offensive edit

answered 2013-01-23 07:05:25 +0800

jj gravatar image jj
638 3

@rickcr I may be misunderstanding your situation, but if you can customize the Siteminder timeout html, then in that html, you can simply put some javascript like:

<html>    <body onload="window.location='myZKApp/login.zul'" >....
link publish delete flag offensive edit

answered 2013-01-25 10:16:53 +0800

rickcr gravatar image rickcr
704 7

updated 2013-01-25 10:17:31 +0800

The solution for us (provided through Jimmy Shiau of the support team) was to override confirmRetry

 zAu.confirmRetry =  function (msgCode, msg2) {
    window.location = "/OurAppName";
 };

Note this will still end up returning your siteminder timeout html response, but at least now it'll behave properly as the response from siteminder will render in the browser and not within ZK's ajax.

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: 2012-03-09 10:26:34 +0800

Seen: 303 times

Last updated: Jan 25 '13

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