Example usage for org.springframework.boot.actuate.endpoint.web EndpointServlet getServlet

List of usage examples for org.springframework.boot.actuate.endpoint.web EndpointServlet getServlet

Introduction

In this page you can find the example usage for org.springframework.boot.actuate.endpoint.web EndpointServlet getServlet.

Prototype

Servlet getServlet() 

Source Link

Usage

From source file:org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar.java

private void register(ServletContext servletContext, ExposableServletEndpoint endpoint) {
    String name = endpoint.getId() + "-actuator-endpoint";
    String path = this.basePath + "/" + endpoint.getRootPath();
    String urlMapping = path.endsWith("/") ? path + "*" : path + "/*";
    EndpointServlet endpointServlet = endpoint.getEndpointServlet();
    Dynamic registration = servletContext.addServlet(name, endpointServlet.getServlet());
    registration.addMapping(urlMapping);
    registration.setInitParameters(endpointServlet.getInitParameters());
    logger.info("Registered '" + path + "' to " + name);
}