How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server

Posted on

Introduction

This is an article where the main focus of the content is actualy pointing out how to create a new maven web application project. It consists of several parts. The first part is the process for creating the web application project. The following part after is the process to build it. The last one is the part for deploying it to the Web Application Server.

Create the Web Application Project

In order to create the Web Application Project, there are several steps to achieve it in the form of the following sequence :

  1. Access the NetBeans IDE. In this article, the NetBeans IDE has the version of 8.2. The following image is the image of a NetBeans IDE appearing after the execution :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  2. After the NetBeans IDE appear, access menu File > New Project. By accessing and executing the menu, the following window dialog box will appear :

    How to Create a New Maven Web Application Project with JSF Framework along with PrimeFaces Components
  3. The above window dialog box is for creating a new project. Select the project type. First of all, choose Maven as the selected category in the Categories list. Do not also forget to choose ‘Web Application’ as the type of Projects in the Projects list as in the following image :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  4. Soon, after clicking the Next button, the following window dialog box will appear :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server

    It is the part for describing the name and the location of the project. For the detail of the above windows dialog box, adjust it accordingly. Fill and adjust the entry of the Project Name and also the Group Id.

  5. Finally, the last one is to set the server. Fortunately, in this article, the environment where the application exist has an available Application Server. It is the Wildfly Application Server as follows :

  6. Final step in this part, just click the Finish button to finish creating the Web Application Project.

The next part, is a part to build the Web Application Project. As a matter in fact, there are no modification at all to the Web Application Project. The main purpose is to show how create, to build and to deploy it to an Application Server.

 

Build Web Application Project

So, the next part is the part for building the Web Application Project. Just continue on the previous part. The following are sequences for building the Web Application Project :

  1. First of all, access the Netbeans IDE as exist in the following image :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  2. Right Click at the project name label in the Projects Tab. In this case, it is the project with the label name of ‘myproject’. The following is the image of the display :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  3. Soon after clicking the menu ‘Clean and Build’, the process for removing the previous build output and rebuilding the source code will continue on. The following is the image of building and generating it :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  4. Select Clean and Build from the menu appear upon executing the Right Click on the project. It will start to clean up and build the project. In the end of the process the resulting output is in the form of a war file. It exist in the folder with the name of target inside the root of the Web Application Project. The following is the content of root project of the Web Application Project with the name of ‘myproject’ :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server

    So, there is a new generated file with the name of myproject-1.0-SNAPSHOT.war. That marks the end of the build process part.

Deploy Web Application Project

Actually, deploying the war file as the result of the build process in the previous step is very simple. It is the last step to be able to execute the Web Application. The steps exist as follows :

  1. Start the Wildfly Application Server. In this context, the execution process for starting Wildfly Application Server is in the command line interface. Read the article with the title of ‘How to Run Wildfly Java Application Server via Command Line’ in this link. Another article’s reference also exist in this link. It is an article with the title of ‘How to Deploy a Java Web Application to a Wildfly Application Server’. The following is the actual execution that exist in a workstation using Windows as its operating system :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  2. If the Wildfly Application Server is running successfully, the output will be exist as follows :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  3. For the next step, just access the Wildfly Administration Page with the default address of http://ip_address_server:9990. It exist as in the following image :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  4. Enter the correct username and password for logging in to the Wildfly Administration Page, the following page will appear :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  5. Click the Deployments link, the following page will appear :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server

    Next, after clicking the Upload Deployment link in the image above, the following page will appear :

  6. The following is a window pop-up that appear as an interface to receive the file of the Web Application project exist from the previous building process :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  7. Drag and drop the war file that exist from the previous part on building the Web Application Project as follows :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  8. As soon as the drag and drop process is a success, try to scroll the page and find the Next button :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server

    Just click the Next Button to continue on the deployment process.

  9. This page will appear as a result of clicking the Next Button. In this page, there are some reviews and information about the deployment setting. Just click the Finish button to proceed :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  10. As soon as the Finish button is clicked, the deployment process will start. The following is the display of the deployment process :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  11. If the deployment process is a success, the following page will appear in the image below :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  12. Close it by clicking the Close button or click the link of View Deployment, it will redirect the page into the following page for a review :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server
  13. In order to check the result of the deployment process, just access the page as in the following image :

    How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server

    The default address for accesing the Web Application is ‘http://ip_adddress_server:8080’. In order to access a specific Web Application, just add the name of the war file as exist in the deployment process.

    So, the address for accessing the Web Application exist in ‘http://ip_adddress_server:8080/myproject-1.0-SNAPSHOT. Where myproject-1.0-SNAPSHOT is the name of the war file in this context.

Leave a Reply