Tomcat home page is not showing when running in Eclipse

后端 未结 3 2132
一生所求
一生所求 2020-12-31 18:22

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 40

3条回答
  •  滥情空心
    2020-12-31 19:05

    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.

    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.

    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.

    enter image description here

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

    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.

提交回复
热议问题