Let me start by using in real life:
DWR gets confused when server-side authentication filters try to redirect AJAX requests to the login page due to an expired session. You want to add some filters to
- Requests with an HTTP status code of 3xx perform client-side redirection, for example window.location = ... login.html
- A request whose status codes are 2xx are forwarded unchanged to any registered handlers such as DWR.
- Other codes, such as 4xx , may trigger warnings instead of disappearing into the abyss.
I probably don't need to explain why this type of functionality would be useful; most web server frameworks support the interceptor pattern for the same reasons that can occur on the client.
One (possibly bad) implementation may include moving the raw XMLHttpRequest object to a proxy server that accepts some filter functions. Since jQuery, Prototype, ExtJS, etc. Everyone wraps their own AJAX browser objects, this may be another step.
Can this be implemented initially? What are the technical issues? Has something like this been done before?
source share