Eclipse Tomcat Project Structure

V

vivienne wykes

Hi All,

I am using Eclipse 3.0 with a Tomcat plug in.
I am trying to create multiple web projects using Tomcats webapps
directory. Eclipse will let me set up one project with under the webapps
folder but when I try to add a new project I get the following error
C:/jakarta-tomcat-4.1.30/webapps and C:/jakarta-tomcat-4.1.30/webapps
overlap.

This I am sure will have a simple explanation... I am thinking that it
should be ok to work on multiple web projects with different names at the
same time under Tomcats webapps folder ?

Thanks in advance

Jim
 
A

Andoni

I don't know about configuring Eclipse but I do know that you can very
easily configure Tomcat to get around this problem. All you have to do is
create two folders called:

webapps/project1
and
webapps/project2

to house the two projects. Then add <Context> elements into your server.xml
file to tell tomcat where your projects are. You specify the location of a
project's web.xml file to Tomcat by telling it the name of the folder that
contains the WEB-INF directory. This is done in the docBase="" attribute of
the <Context> element.

Hope that helps.

Andoni.
 
B

Bryce

Hi All,

I am using Eclipse 3.0 with a Tomcat plug in.
I am trying to create multiple web projects using Tomcats webapps
directory. Eclipse will let me set up one project with under the webapps
folder but when I try to add a new project I get the following error
C:/jakarta-tomcat-4.1.30/webapps and C:/jakarta-tomcat-4.1.30/webapps
overlap.

This I am sure will have a simple explanation... I am thinking that it
should be ok to work on multiple web projects with different names at the
same time under Tomcats webapps folder ?

Well, to get multiple webapps in Tomcat, you (generally) have a
subdirectory in the webapp's folder. For example:

<TOMCAT HOME>/webapps/project1
<TOMCAT HOME>/webapps/project2

Just make project1 and project2 seperate Eclipse projects. Me
personally, I prefer a different approach. I have a folder somewhere
on my drive, independant of Tomcat. I usually setup the following src
directory:

<project>
<project>/src/java
<project>/src/test
<project>/lib // For libraries not needed to be deployed
<project>/webroot
<project>/webroot/WEB-INF
<project>/webroot/WEB-INF/classes
<project>/webroot/WEB-INF/lib
.....

Java classes compile to <project>/webroot/WEB-INF/classes. In Tomcat,
I specify a Context, and point the doc root to the webroot directory
above. Makes it easy to deploy, change appservers, etc. Plus,
everything is in a nice neat package that can be easily backed up,
since all my projects (even non-Tomcat related ones) are located in
the same place.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top