in src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java [190:211]
protected void setup(final Config config) {
// configure method filter
this.allowTrace = config.sling_trace_allow();
String servletName = config.servlet_name();
if (servletName == null || servletName.isEmpty()) {
servletName = this.productInfoProvider.getProductInfo();
}
if (this.servletRegistration == null) {
this.servletRegistration =
bundleContext.registerService(Servlet.class, this, getServletContextRegistrationProps(servletName));
} else {
// check if the servlet name has changed and update properties
if (!Objects.equals(
servletName,
this.servletRegistration
.getReference()
.getProperty(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME))) {
this.servletRegistration.setProperties(getServletContextRegistrationProps(servletName));
}
}
}