-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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?
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?
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?
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.)
@ 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?
@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'" >....
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.
Asked: 2012-03-09 10:26:34 +0800
Seen: 303 times
Last updated: Jan 25 '13