Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclispe's Dynamic Web Project

 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've got to make your own context file. This is explained here.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18025
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for this info guys!

Is there a way to tell Eclipse to physically deploy a web project into the tomcat/webapps folder?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic