I would like to know how to add a (third-party) servlet to the management port in Spring Boot? I know that I can easily add a servlet using, for example, this approach:
@Bean
public ServletRegistrationBean myServlet() {
return new ServletRegistrationBean(new MyServlet(), "/myservlet");
}
But this servlet will be open to the external / application port (default 8080), which is not what I want.
Johan source
share