springboot 打 war 包后的访问路径

发布时间 2023-10-18 17:01:39作者: laremehpe

http://laremehpe.eu.org:9090/api/access/time

 

域名:http://laremehpe.eu.org

端口号:9090

访问路径:/api/access/time

/api 是tomcat解压后文件夹名称

/access 是类上的路径名称(@RequestMapping)

/time 是方法上的路径名称(@RequestMapping)

 

这里的9090指的是访问服务器的9090端口 不一定是tomcat的访问端口!!

下图通过将外部访问的9090端口映射到内部的9090端口,所以访问9090就等于访问tomcat的9090端口

 

还需要注意一点springboot打war包的yaml配置的端口是不生效的,需要配置tomcat里面的 ./conf/server.xml 的端口

war包解压后的路径:/api

 后续的路径:/access/time

 最后访问: