在Eclipse中运行时,Tomcat主页未显示 [英] Tomcat home page is not showing when running in Eclipse

查看:264
本文介绍了在Eclipse中运行时,Tomcat主页未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Eclipse中运行Tomcat。我想查看Tomcat主页,但是它没有显示。当我浏览 http:// localhost:8080 时,出现HTTP 404页面未找到错误。

I'm running Tomcat in Eclipse. I would like to see the Tomcat home page, however it doesn't show up. When I browse http://localhost:8080, then I get a HTTP 404 Page Not Found error.

这是怎么引起的,我该如何解决?

How is this caused and how can I solve it?

推荐答案

默认情况下,Eclipse不会独立使用Tomcat。取而代之的是,它取代了其唯一的服务器引擎,并使用工作区作为部署空间,而不是Tomcat自己的 / webapps 文件夹。它还在 Servers 项目中创建配置文件的副本,例如 server.xml 。它取消了Tomcat的安装。它取消了Tomcat的默认主页(和管理器)。它不影响现有的部署。

Eclipse does by default not use Tomcat standalone. Instead, it overtakes its sole server engine and uses the workspace as deployment space instead of Tomcat's own /webapps folder. It also creates copies of configuration files like server.xml in the Servers project. It untouches the Tomcat installation. It untouches the Tomcat default homepage (and manager). It untouches existing deployments.

由于Tomcat主页不是Eclipse项目之一(也不会成为Eclipse项目之一),因此从Eclipse内部启动Tomcat时不会看到它。您只会看到添加/删除项目部署到服务器的Eclipse项目。我不确定为什么您需要查看Tomcat主页,因为它在开发Java EE Web项目时没有任何价值。但是,如果由于某种不明确的原因而对安装它真的一无所知,那么您不仅需要让Eclipse超越其引擎,而且要完全使用独立安装。

As the Tomcat homepage is not one of Eclipse projects (nor would become one), you won't see it when starting Tomcat from inside Eclipse like that. You would only see Eclipse projects which are deployed to the server by Add/Remove projects. I'm not sure why you need to see the Tomcat homepage as it has no utter value while developing Java EE web projects. But if you are really dead set on seeing it for some unclear reason, then you'd need to tell Eclipse to not only overtake its engine, but instead use the standalone installation at its entirety.

要进行配置,请在 Servers 视图中双击Tomcat的条目以打开其配置,然后在 Server Location 部分中选择选项 Use Tomcat installation

To configure that, double click Tomcat's entry in Servers view to open its configuration and in the Server Locations section, choose the option Use Tomcat installation.

现在您将能够看到Tomcat的主页。

You'll now be able to see Tomcat's homepage.

再次,其好处值得怀疑。请注意,这种方式Eclipse将修改Tomcat安装。因此,Tomcat安装可能无法在其他IDE /工作区之间重用。您需要创建一个全新的Tomcat安装。

Again, the benefit is highly questionable. Do note that this way Eclipse will modify the Tomcat installation. So the Tomcat installation may not be reuseable across other IDEs/workspaces. You'd need to create a whole new Tomcat installation.

这篇关于在Eclipse中运行时,Tomcat主页未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆