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
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:
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestServlet
RestServlet.Builder<R extends RestServlet,SELF extends RestServlet.Builder<R, SELF>>, RestServlet.DefaultBuilder<R extends RestServlet> -
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
ConstructorsModifierConstructorDescriptionNo-arg constructor — uses a defaultFaviconProviderworker.protectedFaviconServlet(FaviconProvider worker) Worker constructor. -
Method Summary
Modifier and TypeMethodDescription[GET /*] — serve the configured favicon bytes.Methods inherited from class org.apache.juneau.rest.server.servlet.RestServlet
builder, createAuthenticator, destroy, doLog, getContext, getPath, getPaths, getRequest, getResponse, getRestBuilder, init, log, log, service, setContextMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, isSensitiveHeader, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
FaviconServlet
public FaviconServlet()No-arg constructor — uses a defaultFaviconProviderworker. -
FaviconServlet
Worker constructor.- Parameters:
worker- The shared flavor-neutral favicon worker this servlet delegates to. Must not benull.
-
-
Method Details
-
getFavicon
[GET /*] — serve the configured favicon bytes.- Returns:
- The favicon as an
HttpResourcewith proper headers.
-