AbstractReactiveWebInitializer supports Servlet mapping

Issue: SPR-16155, SPR-16144
master
Rossen Stoyanchev 7 years ago
parent 8c33ed02b3
commit 4534c5fbfc
  1. 11
      spring-web/src/main/java/org/springframework/web/server/adapter/AbstractReactiveWebInitializer.java

@ -62,7 +62,7 @@ public abstract class AbstractReactiveWebInitializer implements WebApplicationIn
Assert.notNull(registration, "Failed to register servlet '" + servletName + "'.");
registration.setLoadOnStartup(1);
registration.addMapping("/");
registration.addMapping(getServletMapping());
registration.setAsyncSupported(true);
}
@ -93,4 +93,13 @@ public abstract class AbstractReactiveWebInitializer implements WebApplicationIn
*/
protected abstract Class<?>[] getConfigClasses();
/**
* Return the Servlet mapping to use. Only the default Servlet mapping '/'
* and path-based Servlet mappings such as '/api/*' are supported.
* <p>By default this is set to '/'.
*/
protected String getServletMapping() {
return "/";
}
}

Loading…
Cancel
Save