myeclipse修改发布工程名称

  选中工程,右键properties, myeclipse下的web选项,
  Web-root folder:   这个是指你当前工程下WebRoot的文件名,默认WebRoot,这里是WebContent。
  Web Context-root:  这个是你希望发布之后的应用名称,默认为Webroot,可以修改你自定义的。这里改为"cfcinf"。

 
  还有一个是工程目录下,有个.mymetadata的文件,打开之后会看到:
  <?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
  name="cfcinf"
  id="myeclipse.1342513173210"
  context-root="/cfcinf"
  j2ee-spec="5.0"
  archive="cfcinf.war">
  <attributes>
    <attribute name="webrootdir" value="/WebContent" />
  </attributes>
</project-module>


context-root="/cfcinf"就是你完成第一步之后,现在发布之后自定义的工程名称,
<attribute name="webrootdir" value="/WebContent" /> 是你原工程的目录名称,就是上一步粗线的WebContent。

这样修改完之后,你的原工程下的目录名称为WebContent,发布到容器之后的应用名为cfcinf。

还要保证在myeclipse里出现的两个名称要跟.mymetadata下的名称匹配。不然部署工程会出现nullpointerException的异常。

你可能感兴趣的:(Web,MyEclipse)