webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Async call after Session Timeout

    Posted Thu July 05, 2007 07:58 AM

    Hi!
    We are using lots of async control (Ajax) from WMPortal 7 . We would like to know how to handle Ajax error (espacially session time out).
    ie: we would like to send the user to the login page if he click to a async control button after the session timeout occur!
    Thanks


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 2.  RE: Async call after Session Timeout

    Posted Tue July 10, 2007 10:34 AM

    FYI: we’ve made some improvements in this area for the upcoming release, but in the meantime, you can always increase the session length to minimize the number of times this occurs.

    Regards,
    –mark


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 3.  RE: Async call after Session Timeout

    Posted Tue July 10, 2007 12:24 PM

    To remove the default CAF async error handlers on a page, invoke the following javascript:

    CAF.Dialag.WarnAppender.stop();
    CAF.Dialog.ErrorAppender.stop();

    To add your own handler, invoke the following javascript:

    Logger.addAppender(function(message, level, category) {
    // custom handling logic here, for example:
    // CAF.Dialog.warn(message)
    }, Logger.WARN);

    Following is an example handler that will refresh the page with a login screen if the user’s session has timed out, and do nothing (not display any error message) otherwise:

    Logger.addAppender(function(message, level, category) {
    if (message.match(/<form[^>]name\s=\s*[“‘][^’”]*login/i)) {
    document.location.href = document.location.href + (document.location.href.indexOf(‘?’) == -1 ? ‘?’ : ‘&’); + “t=” + new Date().getTime();
    }
    }, Logger.WARN);

    Note that as Mark said, MWS 7.1 will detect if the user’s session has timed out, and display a session timeout message and link to login page instead of a generic error message.</form[^>


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 4.  RE: Async call after Session Timeout

    Posted Tue July 10, 2007 12:31 PM

    Hmm, try finding the above message in this page’s html source to see the correctly formatted source code.


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 5.  RE: Async call after Session Timeout

    Posted Fri October 12, 2007 12:36 AM

    I am trying to redirect the user on login page instead of showing the error message. Following is the code that i use

    Logger.addAppender(
    function(message, level, category) {


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 6.  RE: Async call after Session Timeout

    Posted Wed May 07, 2008 10:02 AM

    Mark,

    Is this issue resolved in 7.1 version?

    Khurram


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 7.  RE: Async call after Session Timeout

    Posted Mon May 12, 2008 12:45 PM

    Nothing has changed in this regard for mws 7.1.x. The regular expression

    /<form[^>]name\s=\s*[“‘][^’”]*login/i

    (you have to view the html source of the page to see the actual expression) matches a form element with a name attribute containing “login”. The above code assumes that if the async response contains a form like this instead of the content it expected, the user’s session has timed out. If you have a custom login form, your custom login form might not match this expression.</form[^>


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods