MockMvc WebAppConfiguration: Load servlet mappings in web.xml
问题 I'm writing integration tests using MockMvc, and I'm wondering if there's a way to load servlet mappings from web.xml (which normally shouldn't matter). I have a custom HandlerInteceptor that matches the request URI (from HttpServletRequest ) against a template (using AntPathMatcher ). In web.xml, I define servlet mappings like this (with a corresponding mobile-context.xml): <servlet-mapping> <servlet-name>mobileServlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping>