问题:
测试接口时候,调用接口http://127.0.0.1:9081/test-module/test请求返回404,去掉链接的/test-module能正常请求。IDEA中server.context-path报警告,由此可推断springboot的server.context-path不起作用。
解决:
配置跟springboot的版本有关系,server.context-path在springboot的2.0.0版本以下起作用,而server.servlet.context-path是springboot的2.0.0以上版本起作用。而项目中springboot是2.4.5版本,所以server.context-path配置不起作用。



