Java HTTP状态404:Tomcat服务器启动,但出现bowser get 404错误

Java HTTP状态404:Tomcat服务器启动,但出现bowser get 404错误,java,eclipse,tomcat,Java,Eclipse,Tomcat,在Eclipse中,启动tomcat服务器后,localhost:8080显示404错误 尝试了以下选项,但没有帮助我 Click on Window > Show view > Server or right click on the server in "Servers" view, select "Properties". In the "General" panel, click on the "Switc

在Eclipse中,启动tomcat服务器后,localhost:8080显示404错误

尝试了以下选项,但没有帮助我

Click on Window > Show view > Server or right click on the server in "Servers" view, select "Properties".
In the "General" panel, click on the "Switch Location" button.
The "Location: [workspace metadata]" should replace by something else.
Open the Overview screen for the server by double clicking it.
In the Server locations tab , select "Use Tomcat location".
Save the configurations and restart the Server.

然后在eclipse中创建了另一个工作区,然后添加了tomcat服务器以查看它是否工作,但仍然存在相同的错误。

404错误由(正在运行的)tomcat服务器显示,这意味着您正在查找的资源在服务器上不可用。您必须确保项目已发布到服务器:

右键单击要访问的项目或资源(例如servlet类),然后“运行方式>>在服务器上运行”->选择您创建的tomcat实例或创建一个新实例


然后eclipse应该将您引导到正确的URL,在那里您可以找到资源(如果资源已成功发布)。

如果我们将项目添加到tomcat服务器,那么它将被部署并显示欢迎页面。但当我们没有项目时,tomcat主页应该显示,而不是显示。是因为根文件夹没有任何文件。您试图访问服务器上的哪个路径?为什么不是404呢?