eclipse中的java项目转web项目

参考blog:http://ywchen.iteye.com/blog/1127357

项目来源:版本库检出web项目,myeclipse导入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) ,在左侧列表项目中点击选择“Project Facets”,在右侧选择“Dynamic Web Module”(版本号需与tomcat版本号相互支持)和"Java",点击further config修改WebContent

4、若导入的web项目无WebContent(即web-inf直接在项目根目录下),按上述方法建好web工程,进入tomcat服务器中的 server.xml将path="/project_name"改为path="/",将上述方法新建的web根目录删掉,classes(指定到 web-inf想必这个大家都知道),重启tamcat即可

猜你喜欢

转载自zhengfc323.iteye.com/blog/1483992