原来项目名称是 PetStore
部署到tomcat输http://localhost:8080/PetStore浏览主页
把项目名改成MyPetStore
解决方案:
右击项目名->Refactor->Rename->new name: MyPetStore
右击项目名->Properties->Web Project Setting-> Context Root: MyPetStore
实际上更改的文件:
.project : /projectDescription/name:MyPetStore
.settings/.eclipse.wst.common.component:
<wb-module deploy-name="MyPetStore">
<property name="context-root" value="MyPetStore"/>
记得把发布到tomcat的工程删掉(包括webapps和work目录),重新部署下.
更名后的访问地址: http://localhost:8080/MyPetStore