Search in sources :

Example 36 with SimpleUrlHandlerMapping

use of org.springframework.web.servlet.handler.SimpleUrlHandlerMapping in project spring-boot by spring-projects.

the class WebMvcAutoConfigurationTests method getResourceResolvers.

protected List<ResourceResolver> getResourceResolvers(String mapping) {
    SimpleUrlHandlerMapping handler = (SimpleUrlHandlerMapping) this.context.getBean("resourceHandlerMapping");
    ResourceHttpRequestHandler resourceHandler = (ResourceHttpRequestHandler) handler.getHandlerMap().get(mapping);
    return resourceHandler.getResourceResolvers();
}
Also used : ResourceHttpRequestHandler(org.springframework.web.servlet.resource.ResourceHttpRequestHandler) SimpleUrlHandlerMapping(org.springframework.web.servlet.handler.SimpleUrlHandlerMapping)

Aggregations

SimpleUrlHandlerMapping (org.springframework.web.servlet.handler.SimpleUrlHandlerMapping)36 Test (org.junit.Test)25 ResourceHttpRequestHandler (org.springframework.web.servlet.resource.ResourceHttpRequestHandler)9 MockHttpServletRequest (org.springframework.mock.web.test.MockHttpServletRequest)8 HandlerExecutionChain (org.springframework.web.servlet.HandlerExecutionChain)7 WebSocketHttpRequestHandler (org.springframework.web.socket.server.support.WebSocketHttpRequestHandler)6 Map (java.util.Map)5 MockHttpServletResponse (org.springframework.mock.web.test.MockHttpServletResponse)5 HandlerMapping (org.springframework.web.servlet.HandlerMapping)5 ModelAndView (org.springframework.web.servlet.ModelAndView)5 DefaultServletHttpRequestHandler (org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler)5 HandshakeInterceptor (org.springframework.web.socket.server.HandshakeInterceptor)5 OriginHandshakeInterceptor (org.springframework.web.socket.server.support.OriginHandshakeInterceptor)5 SockJsHttpRequestHandler (org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler)5 LinkedHashMap (java.util.LinkedHashMap)3 HttpRequestHandler (org.springframework.web.HttpRequestHandler)3 ParameterizableViewController (org.springframework.web.servlet.mvc.ParameterizableViewController)3 RequestMappingHandlerMapping (org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2