且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HTTP 状态 404 - 请求的资源 (/) 不可用

更新时间:2022-06-13 22:41:09

你在期待什么?默认的Tomcat主页?如果是这样,您需要配置 Eclipse 以从 Tomcat 接管控制.

What are you expecting? The default Tomcat homepage? If so, you'll need to configure Eclipse to take control over from Tomcat.

双击Servers 选项卡中的Tomcat 服务器条目,您将获得服务器配置.在左栏的Server Locations下,选择Use Tomcat installation(注意,当它变灰时,阅读部分前导文本!;) ).这样 Eclipse 将完全控制 Tomcat,这样当从 Eclipse 内部运行时,您还可以使用 Tomcat 管理器访问默认的 Tomcat 主页.我只是不明白这在使用 Eclipse 进行开发时有什么用处.

Doubleclick the Tomcat server entry in the Servers tab, you'll get the server configuration. At the left column, under Server Locations, select Use Tomcat installation (note, when it is grayed out, read the section leading text! ;) ). This way Eclipse will take full control over Tomcat, this way you'll also be able to access the default Tomcat homepage with the Tomcat Manager when running from inside Eclipse. I only don't see how that's useful while developing using Eclipse.

端口号不是问题.否则,您将在 Tomcat 的启动日志中遇到异常,并且浏览器将显示特定于浏览器的连接超时"错误页面(因此,当 Tomcat 未启动和运行时,不可能提供服务的特定于 Tomcat 的错误页面!)

The port number is not the problem. You would otherwise have gotten an exception in Tomcat's startup log and the browser would show a browser-specific "Connection timed out" error page (and thus not a Tomcat-specific error page which would impossibly be served when Tomcat was not up and running!)