I have a Jersey app configured with Spring Security handling authentication. The jersey-spring package is providing the SpringServlet class that is registered in my web.xml as a servlet.
Authentication and all works as expected. What I'm wondering is how to have the AuthenticationExceptions (and other filter exceptions) sent through the Jersey servlet, so I can use our ExceptionMapper to process them.
Originally the SpringServlet was configured as a filter, but after doing some reading I came to understand that a servlet should be able to handle the Exceptions thrown in the filters (maybe that's an incorrect understanding). I don't notice any change in behavior after changing it to a servlet, and if I trace through the Spring Security code I can see where the HttpServletResponse is being written.
My question: Is it possible to have the Jersey servlet process exceptions thrown by the Spring Security filter?