Tomcat独立启动时,在浏览器访问http://localhost:8080,可以正常显示。
Eclipse启动tomcat,在浏览器访问http://localhost:8080,出现404。
解决:
Eclipse启动tomcat,在server视图中双击tomcat,出现一个窗口,在Server locations那里改为选择第二项Use Tomcat installation(takes control of Tomcat installation)。
如果三个选项都是灰色不可选,则先将tomcat里部署的项目移除,此时选项状态变为可选,选择第二个选项,Ctrl+S保存,关闭。
重新启动tomcat,浏览器访问http://localhost:8080,显示正常。