Class FaviconServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.juneau.rest.server.servlet.RestServlet
org.apache.juneau.rest.server.convention.FaviconServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class FaviconServlet extends RestServlet
Standalone servlet companion of the FaviconMixin mixin.

Mounts as a sibling top-level servlet at /favicon.ico and serves the configured favicon bytes by delegating to a shared flavor-neutral FaviconProvider worker bean — the same worker the mixin and child flavors use, so the forms cannot drift. Browsers fetch /favicon.ico from the site root, so a standalone servlet at that fixed path is the natural deployment for sites that do not compose the mixin into an existing host resource.

Microservice registration:

@Bean Servlet favicon() { return new FaviconServlet(); // auto-mounted at /favicon.ico }

See Also:
Since:
10.0.0
  • Constructor Details

    • FaviconServlet

      public FaviconServlet()
      No-arg constructor — uses a default FaviconProvider worker.
    • FaviconServlet

      protected FaviconServlet(FaviconProvider worker)
      Worker constructor.
      Parameters:
      worker - The shared flavor-neutral favicon worker this servlet delegates to. Must not be null.
  • Method Details