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.

java project

2. Project Facets

Right click on the project properties. Select “Project Facets“, and click “convert to faceted form…

project facets

Check “Dynamic Web Module” and “Java“, and specify the value.

project facets

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.

Modify Faceted Project

3. Web Application Project

Done, the Java project is converted to web application project, see the globe icon on top of the project.

web project
Tags :
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.

Related Posts

Popular Posts