How can I register a secondary servlet with Spring Boot?
Just add a bean for the servlet. It'll get mapped to /{beanName}/
.
@Bean
public Servlet foo() {
return new FooServlet();
}
Also available is the ServletRegistrationBean
@Bean
public ServletRegistrationBean servletRegistrationBean(){
return new ServletRegistrationBean(new FooServlet(),"/someOtherUrl/*");
}
Which ended up being the path I took.