0 Replies Latest reply on Jul 23, 2008 7:45 AM by Michael Heinen

    redirect in filter and oncomplete errors

    Michael Heinen Newbie

      I use a ServletFilter for all requests to check whether user is logged in and his session is still valid. If anything is wrong I redirect the current request to an error page or to the login page. The problem now is that the oncomplete functions are executed and javascript errors occur because another page is shown and the accessed objects are not existing.
      I have nearly 200 a4j:commands and much more javascript function calls in the oncomplete attributes.

      Now my question:
      What is the most effective way to avoid these javascript errors in case of a redirect in an existing application?
      Is there any alternative to:
      a) add EL checks to all oncomplete attributes?
      b) update all called javascript functions and add checks there?

      Is it possible to add javascript check as first element to the oncomplete attributes that result in not executing the remaining functions?