由于以前的项目都是用myeclipse开发的,现在要换成eclipse来开发。但是项目导入到eclipse中发现该项目并不是web项目,也不能部署到tomcat里面去。现在解决了这个问题了。一.请首先确保你的机器上的eclipse是javaee版本的,或者已经安装看wtp插件二.先Close Project,然后修改eclipse工程下的.project文件:在 <natures </natures中加入<natureorg.eclipse.wst.common.project.facet.core.nature</nature<natureorg.eclipse.wst.common.modulecore.ModuleCoreNature</nature<natureorg.eclipse.jem.workbench.JavaEMFNature</nature在 <buildSpec </buildSpec中加入<buildCommand<nameorg.eclipse.wst.common.project.facet.core.builder</name<arguments</arguments</buildCommand<buildCommand<nameorg.eclipse.wst.validation.validationbuilder</name<arguments</arguments</buildCommand三.Open Project,然后刷新项目,在项目-右击-Properties-Project Facets-Modify Project,选择Java和Dynamic Web Module配置Context Root 和Content Directory 以及源码路径。这样就解决了。
温馨提示:内容为网友见解,仅供参考