Expose getters for the configured HandlerMapping's

Issue: SPR-15934
This commit is contained in:
Rossen Stoyanchev
2017-09-21 09:46:26 -04:00
parent c9afdce54b
commit 819ca0dbd4
2 changed files with 26 additions and 1 deletions

View File

@@ -770,6 +770,19 @@ public class DispatcherServlet extends FrameworkServlet {
}
}
/**
* Return the configured {@link HandlerMapping} beans that were detected by
* type in the {@link WebApplicationContext} or initialized based on the
* default set of strategies from {@literal DispatcherServlet.properties}.
* @return immutable list with the configured mappings or an empty list
* @since 5.0
*/
public List<HandlerMapping> getHandlerMappings() {
return this.handlerMappings != null ?
Collections.unmodifiableList(this.handlerMappings) :
Collections.emptyList();
}
/**
* Return this servlet's ThemeSource, if any; else return {@code null}.
* <p>Default is to return the WebApplicationContext as ThemeSource,