Add Servlet to Management Port in Spring Download

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.

+4
source share
1 answer

- @Bean MvcEndpoint ( HTTP) Endpoint ( JMX). Spring MVC Servlet, (, ServletWrappingController). , Jolokia : https://github.com/spring-projects/spring-boot/blob/master/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java.

0

Source: https://habr.com/ru/post/1548352/


All Articles