Class JwtExceptionFilter

All Implemented Interfaces:
jakarta.servlet.Filter, Aware, BeanNameAware, DisposableBean, InitializingBean, EnvironmentAware, EnvironmentCapable, ServletContextAware

@Component public class JwtExceptionFilter extends OncePerRequestFilter
Catches JWT exceptions thrown during request processing and writes error responses.
  • Constructor Details

    • JwtExceptionFilter

      public JwtExceptionFilter()
  • Method Details

    • doFilterInternal

      protected void doFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException
      Filters requests and catches JWT exceptions to write standardized error responses. Allows the filter chain to continue for non-JWT exceptions.
      Specified by:
      doFilterInternal in class OncePerRequestFilter
      Parameters:
      request - the HTTP request
      response - the HTTP response
      filterChain - the filter chain to continue
      Throws:
      jakarta.servlet.ServletException - if servlet processing fails
      IOException - if I/O operation fails