來自:http://jadethao.iteye.com/blog/1331308
eclipse中 將java項目轉換為web項目
1、找到項目工作空間目錄,打開.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>
2、在eclipse的項目上,刷新項目。
3、在項目上,進入屬性(properties)
4、左側列表項目中選擇“Project Facets”,在右側選擇“Dynamic Web Module”和"Java",(如果要修改eclipse默認的WebContent為WebRoot,點擊Further Configuration available...,把默認的Content redirectory修改為WebRoot點擊ok即可。)點擊可以點擊點擊保存,Java項目轉換為web項目。
這是就可以想web項目一樣發布到tomcat上了。
修改如下:
找到:<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>
2、在eclipse的項目上,刷新項目。
3、在項目上,進入屬性(properties)
4、左側列表項目中選擇“Project Facets”,在右側選擇“Dynamic Web Module”和"Java",(如果要修改eclipse默認的WebContent為WebRoot,點擊Further Configuration available...,把默認的Content redirectory修改為WebRoot點擊ok即可。)點擊可以點擊點擊保存,Java項目轉換為web項目。
這是就可以想web項目一樣發布到tomcat上了。