SpringBoot的配置 server.servlet-path 和 server.context-path
沈君 2018-05-02 11:35:06 今天,在配置 SpringBoot 的 application.properties时,发现一个问题。
当有如下配置时:
server.servlet-path = /Demo
访问控制层,会出现NotFond。
当去除掉或者使用server.context-path= /Demo,就能正常访问。
网上找到对这两个配置的说明是:
1、server.context-path设定应用的context-path.
2、server.servlet-path设定dispatcher servlet的监听路径,默认为: /
还是不太懂,有没有人解释一波
开发使用的是idea,所有在配置服务器时就配置Application Context,springboot的配置有没有上面的配置,也是可以的。