2 回答

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超4個(gè)贊
工具:
myeclipse
方法:
1. 在myeclipse中建立一個(gè)java web工程。File-->New-->Web Project
2. 開(kāi)始導(dǎo)入工程中的文件。File-->import
3. 因?yàn)閑clipse中的web部署文件夾叫做webContent,而myeclipse中叫做webRoot,針對(duì)這個(gè)不同需要做一系列的修改。首先在新建的工程上點(diǎn)擊右鍵,選擇"Properties",出現(xiàn)以下對(duì)話(huà)框。請(qǐng)注意紅框區(qū)域,一般都需要修改。
4.將以上webRoot的地方全部改為webContent即可。

TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超5個(gè)贊
具體步驟:
1、通過(guò)eclipse的import方式,將web項(xiàng)目導(dǎo)入。
2、打開(kāi).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、刷新項(xiàng)目,項(xiàng)目->右鍵->Properties->Project Facets->Configuration->custom,選擇Java和Dynamic Web Module(注意版本,如果無(wú)法確定自己的版本,請(qǐng)從高往低測(cè)試)
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、刷新項(xiàng)目,然后查看classpath是否有問(wèn)題。
6、最后,刪除eclipse默認(rèn)的WebContent目錄,Myeclipse默認(rèn)的是WebRoot。
- 2 回答
- 0 關(guān)注
- 917 瀏覽
添加回答
舉報(bào)