使用/ **选择性覆盖请求映射

时间:2018-08-24 21:17:19

标签: java spring spring-mvc

我的应用程序中具有以下映射:

def square(x):
    return(x**2 if type(x) is int else [i**2 for i in x])

我希望/ static / **映射能够按预期工作。我有以下配置:

@RequestMapping(value = "/**", method = RequestMethod.GET)
public String directoryListing(Model model, HttpServletRequest request) throws PathNotFoundException {

,但是public class WebMvcConfig implements WebMvcConfigurer { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { if (!registry.hasMappingForPattern("/static/**")) { registry.addResourceHandler("/static/**") .addResourceLocations("classpath:/META-INF/resources/static/"); } } } 优先。如何获取配置中的映射以覆盖@RequestMapping

0 个答案:

没有答案