Clipse deploy Web project to local tomcat but not found in WebApps 1.
There was a dynamic Web project in my eclipse, and after the local Tomcat ran, the browser was able to access it, but the WebApps in the Tomcat installation directory did not appear in the project directory.
My project is actually composed of two projects, one is now this dynamic Web project (used as a background and some of the foreground details page), and the other is the foreground HTML (static page) prepared for PHONEGAP, the following is the Dynamic Web project, static Web project refer to them.
I want to debug the effect on my phone browser. So I need to publish two projects together, because I need the front desk backstage. The simplest way is to publish a "Dynamic Web project" in Tomcat and then copy the "Static Web project" to the publish directory of the Dynamic Web project. So I can invoke two projects at the same time.
But here's the problem, I didn't find "Dynamic Web Project" in WebApps (the default Project publishing directory) under the Tomcat installation directory.
Browser input Local address: 127.0.0.1:8080 The Tomcat does not appear, stating that the webapps inside of Tomcat's own project (Tomcat management/help documentation, etc.) is not released. It appears that the "Dynamic Web Project" was not published in WebApps, but instead found a place to publish it, but I do not know where the publishing directory is.
So when the Dynamic Web project ran, my static Web project didn't know which directory to put in (in theory I needed to put two items under the same publishing directory so I could access two projects at the same time).
So I went to Google Baidu a bit, after solving the problem, I intend to write this detailed tutorial, often by the predecessors written by the tutorial help, how can not let the spirit of mutual assistance in my here.
2. Reason
After searching for discovery, I could not find the "Dynamic Web Project" in the WebApps under the Tomcat installation directory because Eclipse defaults to deploying the project to the working directory (workspace). metadata.plugins\ Org.eclipse.wst.server.core\tmp0\wtpwebapps, that tmp0 may be some people will have tmp1 or something, not important. (another myeclipse is the default published to the installation directory of WebApps, which is in line with my needs)
In Eclipse, you can find the specific publish directory for your dynamic project in the following ways.
1, there is a servers window next to the Console Output window, click to see your local tomcat. Of course you may have configured one or more tomcat, and you can open the Tomcat configuration page by selecting the Tomcat double-click on the project you are running. (If you have previously turned off the Servers window, you can open it again in the following ways: Eclipse Top Bar – "window–" Show view– "Servers, if not found in Show view Servers can click on the" Other ... ", search for servers in the pop-up window)
2. If everything goes well, you have seen the configuration of Tomcat. Under Server locations you can see three single options:
Use workspace metadata (checked)//published in Workspace
Use Tomcat installation//published in the Tomcat installation directory
Use custom location//Publish in Custom directory
Server Path:tomcat installation directory
Deploy Path: Project Release specific path
3, "Deploy path" is your current project publishing directory.
3. Solve
In order for the project to be deployed by default to WebApps in the Tomcat installation directory (the path is a little bit), I need to select the second item in the server locations above, that is, to publish the installation directory in Tomcat. The button is grayed out and not selectable.
Because you need to clean up the Tomcat environment before you change it, here are the steps:
1. Stop the Tomcat server within eclipse (in the Servers window, select your Tomcat, right-click, stop)
2, delete the project deployed in the container (Servers window, select your Tomcat, there is a small arrow on the left, click to expand to see the items posted above, right-click items, remove (remove), my display is English, Chinese should be called to remove it)
3, clear the container related data (Servers window, select your Tomcat, right, clean ...)
Tada~ done These three steps, you will find that you can modify the above server locations:
1, Find servers location, select the second (use Tomcat installation)
2. Modify the Deploy path to: WebApps in the Tomcat installation directory
3, Ctrl+s save Tomcat Configuration, close the file completion, re-run the project was released to WebApps.
4. Wordy
Mobile phone to access the computer-side Tomcat published projects need to be with the computer in the same reachable network, our simplest is the same LAN.
For example, my phone and computer are connected to the same router:
Computer ip:192.168.1.175
Mobile ip:192.168.1.123
Tomcat Publishing Port: 8080
Mobile phone access to the computer-published projects only need to enter in the browser: 192.168.1.175:8080/Project URL
Of course, the router allows intranet communication, but is generally allowed, not even check the settings on the good.
Eclipse Eclipse Deployment Web project to local tomcat but not found in WebApps