- This topic has 4 replies, 2 voices, and was last updated 17 years, 7 months ago by Marty Hall.
-
AuthorPosts
-
Marty HallMemberIf I have a Web project called “foo” and I deployed it within MyEclipse, it is then accessible as http://hostname/foo/…
However, if I rename (Refactor->Raname) the project to “bar”, it will still be accessible as http://hostname/foo/…. That is, the context root does not get updated when I rename. I have the same problem if I copy/paste a project: the context root still does not get updated.
I can work around this by editing .mymetadata and editing the context-root entry, then restarting MyEclipse. But presumably there is a better and easier way that I have overlooked.
Any suggestions?
Riyad KallaMemberYou can actually edit the context-root under project properties and the MyEclipse > Web preference panel.
Also the context root is not related to the project name. You may have personally adopted a 1:1 relationship between then, but many people don’t. For example a project named “Accounting and Management Module D” will deploy to context root “/admin” or something like that.
We can’t make any assumptions about name == context root, which is why we don’t change it.
Marty HallMemberThanks: I did not know you could right-click on the project, go to Properties, and change the context path there. That is helpful.
Although I agree that it is possible (and sometimes desirable) to have the context path be different than the project name, I still think MyEclipse should update the context path when you copy/rename a project. If I press the “deploy” button at the top, it automatically deploys with the context path matching the project name (and doesn’t give you an option to change it).
An even better option might be: when you deploy, make the textfield showing the context path editable.
Riyad KallaMemberIf I press the “deploy” button at the top, it automatically deploys with the context path matching the project name (and doesn’t give you an option to change it).
When you go to create the deployment for the new copied project, it *should* show you that there is an overlap between the request dir and an existing deployment and ask you to Overlay, Backup, Delete the existing deployment. Did you see that prompt?
An even better option might be: when you deploy, make the textfield showing the context path editable.
You can have that, it’s a Custom Location Deployment type though, as opposed to selecting the specific app server.
NOTE: I’m not disagreeing with you, just trying to show alternatives to get you closer to the desires behavior.
Marty HallMemberIf I press the “deploy” button at the top, it automatically deploys with the context path matching the project name (and doesn’t give you an option to change it).
When you go to create the deployment for the new copied project, it *should* show you that there is an overlap between the request dir and an existing deployment and ask you to Overlay, Backup, Delete the existing deployment. Did you see that prompt?
I always undeploy apps I am not currently working with so that Tomcat 6 starts faster. So, I didn’t see that prompt.
Thanks for the tip about custom deployments; I didn’t know about it.
-
AuthorPosts