2 回答

TA貢獻(xiàn)1836條經(jīng)驗 獲得超3個贊

TA貢獻(xiàn)1788條經(jīng)驗 獲得超4個贊
具體步驟:
1、通過eclipse的import方式,將web項目導(dǎo)入。
2、打開.project文件,將原配置文件中的<buildSpec>...</buildSpec><natures>...</natures>部分替換為以下內(nèi)容: <buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.Jsdt.core.javaScriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.DeploymentDeScriptorValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.Jsdt.core.JsNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures> 3、刷新項目,項目->右鍵->Properties->Project Facets->Configuration->custom,選擇Java和Dynamic Web Module(注意版本,如果無法確定自己的版本,請從高往低測試)
4、修改.settings目錄(可在navigator視圖下查看)中org.eclipse.wst.common.component文件的如下內(nèi)容:
<wb-resource deploy-path="/" source-path="/WebContent"/>
改為: <wb-resource deploy-path="/" source-path="/WebRoot"/>
5、刷新項目,然后查看classpath是否有問題。
6、最后,刪除eclipse默認(rèn)的WebContent目錄,Myeclipse默認(rèn)的是WebRoot。
- 2 回答
- 0 關(guān)注
- 694 瀏覽
添加回答
舉報