Convert Java Project to Web Project in Eclipse
This tutorial shows you how to convert a Java project to Java web application project in Eclipse 4.2, it should work in older version as well.
1. Java Project
A simple Java project.
2. Project Facets
Right click on the project properties. Select “Project Facets“, and click “convert to faceted form…”
Check “Dynamic Web Module” and “Java“, and specify the value.
By default, Eclipse will generate all “web” related files (like WEB-INF, web.xml) in a “WebContent” folder. If you want change it to another location, Clicks on the “further configuration available…” link.
3. Web Application Project
Done, the Java project is converted to web application project, see the globe icon on top of the project.