MyEclipse中加入web项目到tomcat

时间:2022-10-06 21:28:09
假设导入不是在MyEclipse下建立的web项目,想加入到tomcat中时,会显示“No projects are available for deployment to this server...............”。事实上能够简单地改动两个配置文件:

.project文件:在natures节点中加入webnature

    <natures>
       <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>com.google.gwt.eclipse.core.gwtNature</nature>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>


.mymetadata文件,加入context-root和webrootdir

<?xml version="1.0" encoding="UTF-8"?

>

<project-module
  type="WEB"
  name="DynaTable"
  id="myeclipse.1263372301465"
  context-root="/DynaTable"
  j2ee-spec="1.4"
  archive="DynaTable.war">
  <attributes>
   <attribute name="webrootdir" value="war" />
  </attributes>
</project-module>