How can I register a secondary servlet with Spring Boot?

Also available is the ServletRegistrationBean

@Bean
public ServletRegistrationBean servletRegistrationBean(){
    return new ServletRegistrationBean(new FooServlet(),"/someOtherUrl/*");
}

Which ended up being the path I took.

Leave a Comment