更新web项目名称时

更新web项目名称时,应该更新项目中.mymetadata中的context-root,不然运行会出现HTTP STATUS-404错误。.mymetadata文件出现在Eclipse/MyEclipse的workspace中对应的项目的文件夹下面。

具体格式如下


<?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
  name="WebStruts"
  id="myeclipse.1404091930703"
  context-root="/WebSturts"
  j2ee-spec="5.0"
  archive="WebStruts.war">
  <attributes>
    <attribute name="webrootdir" value="WebRoot" />
  </attributes>
</project-module>

其中context-root务必与项目名称保持一致。

然后重新把项目部署到Tomcat,然后重启Tomcat,问题解决。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章