File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
spring-web/src/main/java/org/springframework/web/server/adapter Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public void onStartup(ServletContext servletContext) throws ServletException {
6262 Assert .notNull (registration , "Failed to register servlet '" + servletName + "'." );
6363
6464 registration .setLoadOnStartup (1 );
65- registration .addMapping ("/" );
65+ registration .addMapping (getServletMapping () );
6666 registration .setAsyncSupported (true );
6767 }
6868
@@ -93,4 +93,13 @@ protected ApplicationContext createApplicationContext() {
9393 */
9494 protected abstract Class <?>[] getConfigClasses ();
9595
96+ /**
97+ * Return the Servlet mapping to use. Only the default Servlet mapping '/'
98+ * and path-based Servlet mappings such as '/api/*' are supported.
99+ * <p>By default this is set to '/'.
100+ */
101+ protected String getServletMapping () {
102+ return "/" ;
103+ }
104+
96105}
You can’t perform that action at this time.
0 commit comments