1- How to create a custom Java EE 7 web application project in NetBeans IDE 7.4
2- How to use JSF 2.2 Frame work
3- How to use Primefaces 3.5 JSF components library to create a Rich web interface based web application 4- How to start and stop Glass Fish Web application Server in NetBeans IDE 7.4
5- How to deploy a Web Application project in Web application server
Following Web Development tools are used in this tutorial
1- NetBeans IDE 7.4
2- Glass Fish Web Application Server
3- Java EE 7 web version
4- JSF 2.2
5- PrimeFaces 3.5
1- How to create a custom Java EE 7 web application project in NetBeans IDE 7.4I hope you have already installed NetBeans IDE 7.4 and Glass Fish Web application Server. Open the NetBeans IDE. There are different ways to create a Project. As showing in snapshot click on new project Icon or press Ctrl+shift+New button, As you click a window will open for project information
2- Choose Project Type:New window has opened to choose a project type. Select Java Web in Categories section and select Web application in Project section.
3- Project Name and LocationGive project name 'MyPrimeFacesProject" and Project location where the projects files will be saved. as showing below. Click next
4- Choose Server and SettingsHere you have option to choose your desired Web application server like Glass Fish Server, Tomecate web server, Weblogic web server etc. We are using Glass Fish Web server . Choose Java ee version which is in our case Java ee 7 web. Choose context path which will show in web browser address bar.
5- Choose Java EE Version Type
6- Choose Java EE Frameworks type like Spring Web MVC, Java Server Faces, Struts etc. We will select Java server faces framework.
7- Choose Preferred JSF page language. Select Facelets by default.
8- Here you can select JSF Components library like PrimeFaces, ICEFaces and RICH Faces. Here select Primefaces components.
9- Click on more button as showing in below snapshot to choose your prefer Primefaces library. As already told, Netbeans IDE have built in support for PrimeFaces library. Do not need to download library files
Clik OK and Next for further step
10- As showing project creation process has been start.
Congratulation, java ee 7 web project has been created. as showing in below snapshot. In left side Project structure and files are showing and on right side Index.xhtml and welcomeprimefaces.xhtml files are opened.
12- Double Click on welcomeprimefaces.xhtml file in lift side to open it. Here you can see the Primefaces components enabled codes for rich interface layout of web page.
13- Here in NetBeans IDE 7.4 Services tab, Expand the Server node, here Glass Fish web application Server is showing. Currently web server is not started. To start web server, right click and select start to start the web application
14- How to start and stop Glass Fish Web application Server in NetBeans IDE 7.3As showing, now Glass fish web server has been started and now applications, Resources and web services folders are showing. Green indication indicates the server is started.
15- How to deploy and Run a Web Application project in Web application serverTo start your web project, right click at top node which is project name "MyPrimeFaceProject", here select RUN option to run the project, If you select Deploy option, project application will deployed in web server, and if you select at RUN option, project will automatically deployed in web server and home page will open in browser.
16- During Project deploying process, deployment process is showing in Netbeans IDE below window as showing in snapshot
17- Your home page has been open which is index.xhtml. Click at PrimeFaces welcome page link to open Primefaces based web page.
18- Now welcomeprimefaces.xhtml web page has been opened and here you can see a rich interface PrimeFaces component Layout.
Congratulation, we have created successfully custom web application project using JSF 2.2 PrimeFaces components, Java EE 7 Technology, JSF Framework, netbeans IDE and Glass Fish Web application server.