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

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

Introduction

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

Prototype

EndpointServlet getEndpointServlet();

Source Link

Document

Return details of the servlet that should registered.

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