地址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
提交
取消