在 Eclipse 中运行时未显示 Tomcat 主页
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14030857/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tomcat home page is not showing when running in Eclipse
提问by user1835080
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.
我在 Eclipse 中运行 Tomcat。我想查看 Tomcat 主页,但它没有显示。当我浏览时http://localhost:8080
,我收到一个 HTTP 404 Page Not Found 错误。
How is this caused and how can I solve it?
这是怎么引起的,我该如何解决?
回答by BalusC
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 Serversproject. It untouches the Tomcat installation. It untouches the Tomcat default homepage (and manager). It untouches existing deployments.
Eclipse 默认不使用 Tomcat 独立。相反,它取代了其唯一的服务器引擎,并将工作区用作部署空间,而不是 Tomcat 自己的/webapps
文件夹。它还创建配置文件的副本,就像server.xml
在Servers项目中一样。它不涉及 Tomcat 安装。它未触及 Tomcat 默认主页(和管理器)。它不涉及现有部署。
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.
由于 Tomcat 主页不是 Eclipse 项目之一(也不会成为一个项目),因此在像这样从 Eclipse 内部启动 Tomcat 时您不会看到它。您只会看到通过Add/Remove projects部署到服务器的 Eclipse项目。我不确定您为什么需要查看 Tomcat 主页,因为它在开发 Java EE Web 项目时没有任何价值。但是,如果您出于某种不清楚的原因真的很想看到它,那么您需要告诉 Eclipse 不仅要超越它的引擎,还要完全使用独立安装。
To configure that, double click Tomcat's entry in Serversview to open its configuration and in the Server Locationssection, choose the option Use Tomcat installation.
要进行配置,请在服务器视图中双击 Tomcat 的条目以打开其配置,然后在服务器位置部分中,选择使用 Tomcat 安装选项。
You'll now be able to see Tomcat's homepage.
您现在将能够看到 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 安装。因此 Tomcat 安装可能无法在其他 IDE/工作区中重复使用。您需要创建一个全新的 Tomcat 安装。
回答by dilipjoshi
In eclipse,right click over tomcat server in servier view. tomcate->properties.click switch location.
在 Eclipse 中,在服务器视图中右键单击 tomcat 服务器。tomcate->properties.click 切换位置。
回答by Suresh Atta
Try the following steps once:
尝试以下步骤一次:
1.Remove schoolManagementsystem folder and war file from webapps folder
1.从webapps文件夹中删除schoolManagementsystem文件夹和war文件
2.Task Manager--> end the all java process
2.任务管理器-->结束所有java进程
3.Now execute the command catalina.bat run
in command prompt.
3.现在catalina.bat run
在命令提示符下执行命令。
Hope this will help you .
希望这会帮助你 。