一、找到workspace目錄下的項目,打開後,裏有個.project文件,從文本編輯工具打開。
二、 在 <natures> </natures>中加入
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
在 <buildSpec> </buildSpec>中加入
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
三、選擇對應的項目右擊Properties->Project Facets ,然後點擊Convert to faceted from....選項,勾選Dynamic Web Module 與 Java選項,點擊Further configuration available ,編輯Content directory,注意,這裏要寫的必須與被轉化的項目下的web目錄的名稱相同,否則會出錯。eclipse下的web目錄爲WebConent,myeclipse下的web目錄爲WobRoot。然後點擊OK按扭即可。
(如 看不到 Further configuration available ,可以修改項目目錄下.settings下的org.eclipse.wst.common.component文件)
- <wb-resource deploy-path="/" source-path="/WebRoot" tag="defaultRootSource"/>