`

Converting a Java project to a Dynamic Web project in Eclipse (通过Project Facets)

阅读更多
Converting a Java project to a Dynamic Web project in Eclipse (基于WTP,通过Project Facets)

What's WTP?
http://www.eclipse.org/projects/project_summary.php?projectid=webtools
引用
The Eclipse Web Tools Platform (WTP) project extends the Eclipse platform with tools for developing Web and Java EE applications. It includes source and graphical editors for a variety of languages, wizards and built-in applications to simplify development, and tools and APIs to support deploying, running, and testing apps.


Converting a Java project to a Dynamic Web project in Eclipse:
http://greatwebguy.com/programming/eclipse/converting-a-java-project-to-a-dynamic-web-project-in-eclipse/

Eclipse – Project Facets:
http://www.beilers.com/2009/05/eclipse-project-facets/



Maven(m2eclipse插件) + WTP + tomcat:
如果是使用m2eclipse导入的maven项目,则你如果觉得手动往local tomcat - webapps里扔war包的过程太麻烦,想在eclipse中的tomcat上做开发部署,肯定是需要为该web项目添加wtp支持的。除了按上面的步骤为该web项目添加project facets外,还需要注意要将该web项目的Maven Dependencies也添加到 部署/发布 路径里去,具体做法:
右键web项目 -> Properties -> Deployment Assembly -> Add -> Java Build Path Entries -> 点选Maven Dependencies并确定。
另外,如果该web项目的Maven Dependencies中有对其他项目的依赖,比如,多个maven modules的情况下,则需要将这几个依赖的项目也添加进去,跟上面的步骤基本相同:
右键web项目 -> Properties -> Deployment Assembly -> Add -> Project -> 点选依赖的项目并确定。
参考资料:
Maven, Eclipse and Tomcat:
http://vijaypm.blogspot.com/2010/12/maven-eclipse-and-tomcat.html
Tomcat & Spring Web - Class Not Found Exception org.springframework.web.context.ContextLoaderListener:
http://stackoverflow.com/questions/6322711/tomcat-spring-web-class-not-found-exception-org-springframework-web-context
Maven project in eclipse - deployment assembly fails build(Invalid classpath publish export Project entries not supported):
http://stackoverflow.com/questions/6799135/maven-project-in-eclipse-deployment-assembly-fails-build






将MyEclipse项目导入到Eclipse中:
http://todaydiy.blog.163.com/blog/static/104189687201021035312604/
引用
1.请首先确保你的eclipse是javaee版本的,或者已经安装看wtp插件
2.然后修改eclipse工程下的.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>

3.刷新项目,项目->右击->Properties->Project Facets->Modify Project,选择Java和Dynamic Web Module
          配置Context Root 和Content Directory 以及源码路径。




A Error:
引用
Java compiler level does not match the version of the installed Java project facet
解决:
http://www.eclipsezone.com/eclipse/forums/t80428.html
引用
A wtp project is composed of multiple units of functionality (known as facets).
Take a look at Project Properties -> Project Facets panel. The java facet version needs to always match the java compiler compliance level.
The best way to change java level is to use the Project Facets properties panel as that will update both places at the same time
Alternatively, when you get the error that you are referring to, there are quick fixes available to resolve it.
分享到:
评论

相关推荐

    Converting Array to Map in Java.zip_in

    7. **可视化辅助**:`Converting Array to Map in Java.png`可能是一个流程图或示意图,帮助理解转换过程的可视化表示。在实际编程中,这类图表有助于解释代码逻辑,特别是在团队协作或技术文档中。 8. **异常处理*...

    C# to Java 代码转换工具

    Running from the command line: C# to Java Converter can be launched directly for a specific project, folder, or file conversion from the command line. Command line.(命令行执行) 其他一些特点: 1. ...

    Java.to.Python 高清完整epub版

    For the engineer who is already proficient in Java, it would be a waste of time to study a Python textbook that begins with the basic concept of object-oriented programming, since the concept of OOP ...

    Moving to Responsive Web Design(Apress,2016)

    As the usage of mobile devices of all shapes and sizes increases exponentially every year, and dominates the manner in which many users access the web, it is now imperative for any business to have a ...

    Designing A Common Sense Approach to Web & Mobile Application Design

    Interface Surgery: Surfacing the bananas in a process 237 Chapter 10: Reduce and Refine 243 Cluttered task flows 244 The path to simplicity 245 Clean Up the Mess 246 Reducing the pixel-to-data ...

    Converting the CONNECT sample to a local server在本地服务器

    "Converting the CONNECT sample to a local server"的主题聚焦于将一个基于CONNECT的示例应用移植到用户的本地服务器环境。这个过程通常包括几个关键步骤,涉及代码调整、配置更改以及对本地环境的适应。 首先,...

    Mastering Lambdas- Java Programming in a Multicore World

    Lambda expressions were introduced in Java 8 as a significant feature to enhance functional programming capabilities within the Java ecosystem. These expressions allow developers to treat functions as...

    Java Language Conversion Assistant

    Java Language Conversion Assistant provides developers using Visual Studio .NET 2003 a quick, low-cost method of converting Java-language applications to Visual C# and the .NET Framework. These ...

    Converting a bitmap to a region - memory leak fix将一个位图

    "Converting a bitmap to a region - memory leak fix" 就是针对这个问题提供的一种解决方案。 位图(Bitmap)是Windows GDI(Graphics Device Interface)中用于存储像素数据的数据结构,它可以表示各种分辨率和...

    WebAssembly: Accessing C and C++ in Web Applications

    By the end of the course, you’ll understand the massive potential WebAssembly represents and be ready to implement it in your next web project. Topics include: Programming for WebAssembly with ...

    MT-008 Converting Oscillator Phase Noise to Time Jitter.

    通过该公式,工程师们可以更加直观地理解振荡器相位噪声对系统时钟稳定性和信号完整性的影响,进而采取相应的设计措施来优化系统性能。 #### 结论 将振荡器相位噪声转换为时间抖动是一种重要的分析工具,它帮助...

    Bytecode to source converting Java &amp; Kotlin code into .zip

    Java和Kotlin是两种流行的编程语言,广泛应用于Android应用开发和其他软件系统。它们的源代码在编译后会转换成字节码(Bytecode),这是一种平台无关的中间表示,可以在Java虚拟机(JVM)或Android虚拟机(ART)上...

    Converting a bitmap to a region - memory leak fix将位图转化

    在Windows API中,`HBITMAP` 是表示位图的句柄,通过 `CreateBitmap`, `CreateCompatibleBitmap` 等函数创建。 区域则是定义在窗口或设备上的一个特定形状,可以用于剪裁、重叠绘制等目的。在Windows API中,`HRGN`...

    Python Web Scraping Cookbook-Packt Publishing(2018).pdf )

    We will cover how to collect it, how to perform several common data operations (including storage in local and remote databases), how to perform common media-based tasks such as converting images an ...

    A Brief Introduction to Sigma Delta Conversion.pdf

    The key feature of these converters is that they are the only low cost conversion method which provides both high dynamic range and flexibility in converting low bandwidth input signals. This ...

    Modern Java Recipes

    Modern Java Recipes: Simple Solutions to Difficult Problems in Java 8 and 9 by Ken Kousen English | 11 Aug. 2017 | ISBN: 149197317X | ASIN: B074R6B13N | 322 Pages | AZW3 | 1.35 MB The introduction of...

    smali2java.jar

    Smali2java is an utility for converting .smali to .java files without bytecode compiling/decompiling. Why not to use dex2jar? I have never told about it. Dex2jar is a good utility and smali2java is ...

    Converting Oscillator Phase Noise to Time Jitter.zip

    "Converting Oscillator Phase Noise to Time Jitter"是ADI公司工程师Walt Kester关于如何将振荡器相位噪声转换为时间抖动的一个深入讲解。这篇资料详细阐述了振荡器的相位噪声与系统时钟抖动之间的关系,以及如何...

Global site tag (gtag.js) - Google Analytics