Question

I've been trying to merge few different projects in to a single one in eclipse. In this attempt I've tried this following steps which causes the context path to be generated differently(incorrectly?).

Core-Problem:

  1. Copied a dynamic web project (Maven) in eclipse and paste as a new project (Cloned-duplicate)
  2. Add the project to embedded Tomcat server in eclipse.
  3. Go to Tomcat Server project in eclipse and open server.xml
  4. Generated < Context > tag contains the following

    <Context docBase="DuplicateApp" path="App" reloadable="true" source="org.eclipse.jst.jee.server:DuplicateApp"/>
    

    I would've expected both 'path' and 'docBase' to point to DuplicateApp, which is the name of the cloned app, however it is appearing incorrect. Is this even expected behavior?

Quite a bit of searching confirms my learning that both 'path & 'docbase' should point to the name of the web application/war file name.

Additional Information:

  1. Eclipse Juno Java EE version installed
  2. M2E plugin installed in Eclipse
  3. Tomcat version 7
  4. pom.xml did not override war name - cross checked.
Was it helpful?

Solution

After desperately refreshing to find no answer to my post, found answer to my own question after few additional hours of slogging!

There seems to be a property named 'Web Project Settings' which can be accessed via Project > properties > 'Web Project Settings' where context root can be changed. Not sure how this get populated or where it is retained just as yet. But atleast this solves my problem!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top