Eclipse Tomcat Project Structure

Discussion in 'Java' started by vivienne wykes, Aug 25, 2004.

  1. 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
    vivienne wykes, Aug 25, 2004
    #1
    1. Advertising

  2. vivienne wykes

    Andoni Guest

    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.


    "vivienne wykes" <> wrote in message
    news:Fb1Xc.14756$...
    > 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
    >
    >
    Andoni, Aug 25, 2004
    #2
    1. Advertising

  3. vivienne wykes

    Bryce Guest

    On Wed, 25 Aug 2004 14:17:09 GMT, "vivienne wykes"
    <> wrote:

    >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.

    --
    now with more cowbell
    Bryce, Aug 25, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas
    Replies:
    1
    Views:
    725
    Robert Olofsson
    Oct 18, 2003
  2. javaguy44
    Replies:
    1
    Views:
    991
  3. Hipo

    Eclipse project structure

    Hipo, Jun 19, 2006, in forum: Java
    Replies:
    2
    Views:
    436
    Mark Space
    Jun 19, 2006
  4. Veerle
    Replies:
    0
    Views:
    1,362
    Veerle
    Mar 13, 2009
  5. Stephane Wirtel
    Replies:
    0
    Views:
    123
    Stephane Wirtel
    Jul 5, 2007
Loading...

Share This Page