地址1:http://localhost:8762/hello
地址2:http://localhost:8762///hello
访问1 和访问2结果一样。
期望的是访问2返回404.
相关代码:
@RestControllerpublic class HelloController { @GetMapping("hello")
public String index() { return "Hello World";
}
}@SpringBootApplicationpublic class EurekaClientApplication extends WebMvcConfigurationSupport {
public static void main(String[] args) { SpringApplication.run(EurekaClientApplication.class, args);
} @Override
protected void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false)
.setUseTrailingSlashMatch(false);
}
}
函数式编程
慕尼黑5688855
随时随地看视频慕课网APP
相关分类