Deploying a WAR in Tomcat / Eclipse

后端 未结 4 2043
广开言路
广开言路 2021-02-08 15:29

I use Tomcat 6.0 and Eclipse 3.0 under Linux and I try to deploy a WAR in Tomcat. The problem is that the server is managed by Eclipse and I have some Eclipse project deployed.

4条回答
  •  误落风尘
    2021-02-08 16:28

    Tomcat behaves differently in development and production mode. When you develop your webapp in Eclipse there is no reason to deploy a WAR file of your application as a WAR during development.

    Just go to the "servers" view and add a new server (you should already have done this otherwise you could not create your Dynamic Web project). In the server view you should see the server you created (Tomcat at localhost or something similar) just right click it and go to the Add and Remove section. Here you can add and remove the Dynamic Web projects you created in Eclipse. Once you added your project, all you have to do is click the green start button in the servers view and your app should be available in at localhost:8080/mycontext.

    When you're done building your app just right click the project and go the the Export section in the menu. You should be able to export a WAR file. Once you have your WAR file you can upload and deploy that on a Tomcat instance that is NOT tied to Eclipse running in dev mode.

提交回复
热议问题