Creating a new Maven web project
There are several ways in which you can create a web application project using Eclipse. Since Maven is the de facto build tool, it makes sense to use the Maven project structure in this example.
Let's start by creating the project file structure. Go to File | New | Maven Project, select skip archetype selection, create a simple project, and proceed to the next page. Then, complete the artifact details as shown in the following screenshot, ensuring that you select war as the packaging:
After clicking on Finish, Eclipse will generate a default folder structure for your application:
We are going to use JSF to create the view. Configuring the JSF 2.2 web application requires very little effort. You can achieve this with the following steps:
- Create a file called
web.xml
and place it in theWEB-INF
folder of your application. - Add the
FacesServlet
to yourweb.xml
file and specify what kind of URL patterns will be directed to it. - Create a
faces-config.xml
file and...