Skip to content

Allow to set loadOnStartup on actuator EndpointServlet's #15672

Closed
@juliojgd

Description

@juliojgd

EndpointServlet endpointServlet = endpoint.getEndpointServlet();
Dynamic registration = servletContext.addServlet(name,
endpointServlet.getServlet());
registration.addMapping(urlMapping);
registration.setInitParameters(endpointServlet.getInitParameters());
logger.info("Registered '" + path + "' to " + name);

Why is setting loadOnStartup not allowed in ServletEndpointRegistrar?
In my specific use case I need that the invocation of 'init' method in wrapped Servlet instance be on startup, not in the first http invocation.
Is there a reason to not provide this option for EndPointServlet's?

To provide it, org.springframework.boot.actuate.endpoint.web.EndpointServlet should contain a property 'loadOnStartup' in addition to already present 'initParameters' property. If there is no reason to not do it, I can provide a PR.

Thanks for answering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions