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:
-
Where is the configuration that
is forcing the url to require the
Eclipse project name? I don’t see
this in the web.xml. -
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
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.settingsdirectory of the project (to be precise, inorg.eclipse.wst.common.component) and will be added later to/Servers/Tomcat v6.0 Server at localhost-config/server.xmlin a<Context>element when you will Add the project to the Tomcat server.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.