Eclipse deploys the web project to the local tomcat but cannot find it in webapps

1. Find the problem

在eclipse中新建Dynamic Web Project,配置好本地的tomcat并写好代码后选择Run on Server,但运行后发现在tomcat的安装目录下的webapps并没有出现所建立的工程名字。

2. Verification

很明显项目并没有自动部署到Tomcat的Webapps中而是部署在了别的容器中。在内置浏览器中输入http://localhost:8080/webDemo/login.jsp可正常打开。但在外部浏览器上打开http://localhost:8080时确没有出现所期望的小猫画面。

3. Reason

Unlike MyEclipse, which deploys the project to the webapps in the tomcat installation directory by default, it deploys the project
to and the tmp1 folder stores it. information about the project.

4. Modification
In order to deploy the project to the webapps in the tomcat installation directory by default, show view—>servers—>find the tomcat that needs to be modified—>right-click ①Stop the Tomcat server in eclipse (stop) ②Delete the Tomcat server deployed in the container Item (add and remove) ③Clear the relevant data of the container (clean) ④Open the modification interface of tomcat (open)
⑤Find the servers location and select the second one (User tomcat Installation) ⑥Modify the deploy path
to Yes ①②③ must be operated, otherwise the following steps will be set as inoperable.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325993670&siteId=291194637