Java Dynamic Web Project with Eclipse
Currently to access my dynamic web project (running in a tomcat servlet container) I access the following 开发者_Go百科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
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.
to change the context root in eclipse please follow the below procedure
Right click on Project-->Properties-->WebProject
精彩评论