3

Currently to access my dynamic web project (running in a tomcat servlet container) I access the following url:

http://localhost:8080/[Eclipse_Project_Name]

I have a couple questions about this:

  1. Where is the configuration that is forcing the url to require the Eclipse project name? I don't see this in the web.xml.

  2. Say I'd like to change the url used to access my project. Maybe I want it to by at the root: localhost:8080/, or maybe a different directory structure altogether. How do I do this?

Thanks

2 Answers 2

10

Where is the configuration that is forcing the URL to require the Eclipse project name? I don't see this in the web.xml.

When you create a New Dynamic Web Project, the first page of the wizard asks you for a Project name and in the third page, you can change the web module settings such as the Context root which defaults to the project name (the context root is the part of the URL you're talking about).

This information is not stored in the web.xml, it is stored in the .settings directory of the project (to be precise, in org.eclipse.wst.common.component) and will be added later to /Servers/Tomcat v6.0 Server at localhost-config/server.xml in a <Context> element when you will Add the project to the Tomcat server.

Say I'd like to change the url used to access my project. Maybe I want it to by at the root: localhost:8080/, or maybe a different directory structure altogether. How do I do this?

Right-click on your project then Properties > Web Project Settings. There you can change the context root. Then go to the Server View, right-click on the Tomcat server and select Clean... and you should get prompted to accept the modification of the server configuration.

Sign up to request clarification or add additional context in comments.

Comments

1

to change the context root in eclipse please follow the below procedure

Right click on Project-->Properties-->WebProject

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.