今天在使用Tomcat的时候,启动之后发现项目可以访问到,但是访问 localhost:8080 却不行了,好家伙,然后一通百度,终于找到了办法,IDEA编译器也不知道为什么还有这种 ** 问题。
感谢这位老哥:https://blog.csdn.net/u012461090/article/details/101288736
- JDK版本:1.8
- Tomcat版本:8.5. xx
- IDEA版本:2020.3.2
解决方案如下:
把 tomcat 安装目录 webapp 下的ROOT文件夹配置到 IDEA 中即可,注意:修改application context为 / ,默认为/ROOT。
操作步骤如下:
之后就可以在IDEA中启动tomcat,发现可以访问到了。