问题:
测试接口时候,调用接口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配置不起作用。
————————————————
版权声明:本文为优快云博主「程序员储物箱」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/qq_39512532/article/details/125406250