Class ErrorFilter

  • All Implemented Interfaces:
    javax.servlet.Filter

    @Component
    @Order(-2147483648)
    public class ErrorFilter
    extends Object
    implements javax.servlet.Filter
    Alternative to Spring Boot's ErrorPageFilter which was causing problems with other filters, because it was trying to send errors after a response was committed.
    Author:
    Alex Bogdanovski [[email protected]]
    • Constructor Detail

      • ErrorFilter

        public ErrorFilter()
    • Method Detail

      • init

        public void init​(javax.servlet.FilterConfig fc)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • doFilter

        public void doFilter​(javax.servlet.ServletRequest request,
                             javax.servlet.ServletResponse response,
                             javax.servlet.FilterChain chain)
                      throws IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        IOException
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter