File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Eclispe's Dynamic Web Project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclispe Watch "Eclispe New topic
Author

Eclispe's Dynamic Web Project

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Hi All,

I am using Eclipse Java EE IDE for Web Developers & Tomcat.

When I run a dynamic web project through eclipse, why do I not see it deployed in the tomcat/webapps folder?

Where does the deployment actually reside?

Thanks.


We must know, we will know. -- David Hilbert
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Your dynamic web project should be associated to a server. You can see your servers in the Servers view. Under your Tomcat server, you should see your application. You should also have a "Servers" project, which holds your Tomcat configuration. In this project, there is a file called server.xml. If you look at its content, you should see a Context tag pointing to your project. That's why your files are not actually deployed to the server. Tomcat knows where it has to find them.


[My Blog]
All roads lead to JavaRanch
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
So when I start tomcat up the usual way, i.e. not from within eclipse, how can I tell it to run a project which is deployed outside of the tomcat/webapps folder?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

You've got to make your own context file. This is explained here.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Joseph Sweet wrote:So when I start tomcat up the usual way, i.e. not from within eclipse, how can I tell it to run a project which is deployed outside of the tomcat/webapps folder?


You provide a Context definition. This can be a META-INF/context.xml file in the WAR or an XML file that you install in the TOMCAT_HOME/conf/Catalina/localhost directory (which will override META-INF/context.xml).

The root of this file is the Tomcat Context element, and the docBase= attribute should have the absolute pathname of the WAR file or of an exploded WAR directory. The app will be deployed under the context name that you provide on the path= attribute.


Customer surveys are for companies who didn't pay proper attention to begin with.
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Thanks for this info guys!

Is there a way to tell Eclipse to physically deploy a web project into the tomcat/webapps folder?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclispe's Dynamic Web Project
 
Similar Threads
http 404 error problem with dynamic project in eclipse
Make a project be dynamic web project
how to map dynamic web project name to root directory
Dynamic Web project with multiple Java projects
Developing servlets using Eclipse 3.3.2