Map this on an URL pattern of /*. Note, if you have static assets like CSS/JS/images behind a different path, you'd like to include a check on their common path like "/static" in the condition, otherwise your admin pages will end up without proper CSS/JS/images.

Two (easily fixed) problems:1) The code causes an infinite loop (check if the request is for contextPath + destination. 2) On GAE you also need to check for contextPath + "/_ah/", to handle admin login.
–
MontyGomerySep 8 '11 at 17:52