This is an automated email from the ASF dual-hosted git repository. paulrutter pushed a commit to branch maintenance/FELIX-6791-Only-a-single-format-can-be-allowed-when-using-Pax-Web in repository https://gitbox.apache.org/repos/asf/felix-dev.git
commit 671b33fe47737371029d2840b9488bb7ae7dbe6c Author: Paul Rütter <[email protected]> AuthorDate: Thu Jul 3 12:59:26 2025 +0200 FELIX-6791 Only a single format can be allowed when using Pax Web - Add unique servlet name to each registered servlet via the whiteboard pattern --- .../apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java index 5c1ca17601..ad1818dce6 100644 --- a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java +++ b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java @@ -20,6 +20,7 @@ package org.apache.felix.hc.core.impl.servlet; import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT; import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME; import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN; +import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME; import java.io.IOException; import java.io.PrintWriter; @@ -253,6 +254,8 @@ public class HealthCheckExecutorServlet extends HttpServlet { private void registerServlet(final ServletInfoDTO servletInfo) { final Dictionary<String, Object> properties = new Hashtable<>(); + // FELIX-6791 Add unique servlet name + properties.put(HTTP_WHITEBOARD_SERVLET_NAME, servletInfo.contextName + "." + servletInfo.servletPath + "." + servletInfo.servlet.getClass().getSimpleName()); if (servletInfo.contextName != null && !servletInfo.contextName.isEmpty()) { properties.put(HTTP_WHITEBOARD_CONTEXT_SELECT, "(".concat(HTTP_WHITEBOARD_CONTEXT_NAME).concat("=").concat(servletInfo.contextName).concat(")")); }
