地址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);
}
}
添加回答
舉報
0/150
提交
取消
