I have a web application (WAR file). When I deploy it through Eclipse 3.5 using the WTP tools, I am able to start the Tomcat server from within Eclipse and view all the page
I recently have to figure out more detail on this topic to troubleshoot application startup issues so I note it here.
It is determined by the server configuration. Double click on the server in the servers view to look at the server "Overview". In the "Server Locations" section, there are default value configured:
.metadata/.plugins/org.eclipse.wst.server.core/tmp0
wtpwebapps
Also the application "module" is defined in the "Modules" tab of the server configuration which specify the application path, document base and the module name. For example, you deploy your project myapp
to the path /MyApp
.
So if your workspace is /home/me/workspace/myapp
, the path to your application deployment directory is:
/home/me/workspace/myapp/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/myapp.
The contents of deployment is determined by "Deployment Assembly" in the project properties. Each entry in the assembly defines what files are deployed to what path. Example:
/src/main/java -> WEB-INF/classes
/src/main/resources -> WEB-INF/classes
/src/main/webapp -> /
Maven Dependencies -> WEB-INF/lib
So if you have the file src/main/webapp/WEB-INF/web.xml
in your source tree, it will be deployed to:
/home/me/workspace/myapp/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/myapp/WEB-INF/web.xml
It's just all definied in the context.xml
which Eclipse has given to Tomcat. If you want to configure this behaviour, then doubleclick the Tomcat instance in the servers view and check the Server locations section. To achieve what you initially want/expected, you need to select Use Tomcat installation and if necessary also specify the Deploy path.