Eclipse中project项目转web项目
2015-08-07 00:00
429 查看
项目被搭建成了project项目,感觉很别扭,所以,手动进行了一下转换,具体步骤如下:
1.进入项目目录,可看到.project文件,打开,找到<natures>...</natures>代码段。
2.将如下代码加入到其中<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>
3.在eclipse的项目上点右键,刷新项目
4.在项目上点右键,进入属性(properties)
5.在左侧列表项目中点击选择“Project Facets”,在右侧选择“Dynamic Web Module”和"Java",点击OK保存即可。
由于我们系统原来的web目录使用的名字是WebRoot,所以,系统又自动生成了一个WebContent目录,这个没关系,直接删除,然后进入到项目目录下。在.settings目录下找到org.eclipse.wst.common.component文件。
其中有这么一句“<wb-resource deploy-path="/" source-path="/WebContent"/>”,将WebContent改为WebRoot即可。
现在一切都已经搞定,可以试着运行一下了,点Run As 却悲剧了,报错“The server does not support version 3.0 of the J2EE Web module specification”,查了一下资料,原来在.settings目录下有一个org.eclipse.wst.common.project.facet.core.xml文件,其中有这么一句“<installed facet="jst.web" version="3.0"/>”将其改为“<installed facet="jst.web" version="2.5"/>”,保存,刷新项目,再运行,ok!
1.进入项目目录,可看到.project文件,打开,找到<natures>...</natures>代码段。
2.将如下代码加入到其中<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>
3.在eclipse的项目上点右键,刷新项目
4.在项目上点右键,进入属性(properties)
5.在左侧列表项目中点击选择“Project Facets”,在右侧选择“Dynamic Web Module”和"Java",点击OK保存即可。
由于我们系统原来的web目录使用的名字是WebRoot,所以,系统又自动生成了一个WebContent目录,这个没关系,直接删除,然后进入到项目目录下。在.settings目录下找到org.eclipse.wst.common.component文件。
其中有这么一句“<wb-resource deploy-path="/" source-path="/WebContent"/>”,将WebContent改为WebRoot即可。
现在一切都已经搞定,可以试着运行一下了,点Run As 却悲剧了,报错“The server does not support version 3.0 of the J2EE Web module specification”,查了一下资料,原来在.settings目录下有一个org.eclipse.wst.common.project.facet.core.xml文件,其中有这么一句“<installed facet="jst.web" version="3.0"/>”将其改为“<installed facet="jst.web" version="2.5"/>”,保存,刷新项目,再运行,ok!
相关文章推荐
- Ehcache整合spring配置 - 单机 入门
- 在Spring中使用注解(@Scheduled)创建计划任务
- eclipse 导出项目到 android studio .so 库
- 尚硅谷公开课--struts2--2--搭建struts2环境以及struts2简单例子
- java序列化与反序列化
- a[href*=javablackbelt]{color:red};
- Eclipse搭建maven开发环境
- java的native关键字
- OpenJDK 和 JDK区别
- Spring Web MVC的介绍
- spring 框架
- struts 框架
- 关于jdk的报错问题 It is indirectly referenced from required .class files
- Spring的AOP小例子,以及遇到的相关ADVICE代码不起作用为题
- Java Persistence with MyBatis 3(中文版) 第四章 使用注解配置SQL映射器
- 关于JAVA Entity entity = entityClass.getAnnotation(Entity.class);
- Hibernate工作原理及为什么要用?
- java生成饼图svg
- JAVA学习笔记(三)
- 深入java单例模式