Example usage for org.springframework.boot.actuate.endpoint.web ExposableServletEndpoint getRootPath

List of usage examples for org.springframework.boot.actuate.endpoint.web ExposableServletEndpoint getRootPath

Introduction

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

Prototype

String getRootPath();

Source Link

Document

Return the root path of the endpoint, relative to the context that exposes it.

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);
}