Class StaticThemeFilter

java.lang.Object
org.codelibs.fess.filter.StaticThemeFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class StaticThemeFilter extends Object implements jakarta.servlet.Filter
Servlet filter that serves a static theme's files directly when a static theme is active for the current virtual host.

The filter writes the response in place via StaticThemeResponder (no RequestDispatcher forward), so the browser address bar keeps the original request URI.

Matching is an allowlist: a request is handled by the theme only when it targets a theme asset or one of the SPA-owned UI paths (see THEME_UI_PREFIXES). Every other request passes through to the standard Fess routes. This is the inverse of a denylist of infrastructure prefixes: it keeps Fess's own endpoints (admin, API, login, crawler/system endpoints, etc.) working by default, and a newly-added Fess route is never accidentally swallowed by the SPA. The trade-off is that a UI route the SPA expects to own must be added to THEME_UI_PREFIXES; an unlisted path is not served as the SPA entry.

Behavior summary:

  • Constructor Details

    • StaticThemeFilter

      public StaticThemeFilter()
      Default constructor.
  • Method Details

    • init

      public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Filter
      Throws:
      jakarta.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Filter
    • doFilter

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