AbstractReactiveWebInitializer supports Servlet mapping
Issue: SPR-16155, SPR-16144
This commit is contained in:
parent
8c33ed02b3
commit
4534c5fbfc
|
@ -62,7 +62,7 @@ public abstract class AbstractReactiveWebInitializer implements WebApplicationIn
|
||||||
Assert.notNull(registration, "Failed to register servlet '" + servletName + "'.");
|
Assert.notNull(registration, "Failed to register servlet '" + servletName + "'.");
|
||||||
|
|
||||||
registration.setLoadOnStartup(1);
|
registration.setLoadOnStartup(1);
|
||||||
registration.addMapping("/");
|
registration.addMapping(getServletMapping());
|
||||||
registration.setAsyncSupported(true);
|
registration.setAsyncSupported(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,4 +93,13 @@ public abstract class AbstractReactiveWebInitializer implements WebApplicationIn
|
||||||
*/
|
*/
|
||||||
protected abstract Class<?>[] getConfigClasses();
|
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…
Reference in New Issue