How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server

Posted on

Introduction

This article is showing how to change the way for a Web Application to be accessed further. Accessing the Web Application is in a different name of the actual file name. Actually, this article has a relation with another article. Those articles are the article with the title of ‘How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server’ in this link. Furthermore, it is also with another article available with the title of ‘How to Deploy a Java Web Application to a Wildfly Application Server’ in this link.

Change or Sorten the Web Application Name in Wildfly Application Server

Basically, this is achievable. Logically speaking, it is possible by changing the name of war file attribute. But the name of war in which process ?. There are two attempts to rename or change it so it will be as short as possible. The first one is the attempt on the middle of the deployment process. Actually, it ends in a failure. But on the other hand, another one is to change it before the deployment process. Fortunately, it is a success.

Change or Sorten the Web Application Name in the middle of the deploying process in Wildfly Application Server

Follow the step in the article with the title of ‘How to Create a New Web Application Project using NetBeans IDE and Deploy it to Wildfly Application Server’ in this link. Another article with a similar content exist in the article with the title of ‘How to Deploy a Java Web Application to a Wildfly Application Server’ in this link. This part will try to shorten the name for further access and make it easily from ‘myproject-1.0-SNAPSHOT.war’ to ‘myproject’.  Just follow the step until the following step exist in the following image :

How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server

Stop continue on the same thing, but from this point on forward, change it to the following step as an attempt which is actually end in failure. This is just a part for proving the wrong way to achieve it. Feel free to skip this part and perform the actual working solution in the following part.

  1. Do not click finish, just rename it first as in the following image :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  2. After renaming it, click the Finish button to proceed on the deployment process. The following page will appear as in the image below :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  3. Soon after the deployment process is a success. The page that will appear informing the success of the deployment process exist in the following image :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  4. Click the View Deployment link or the Close button to proceed on accessing the Web Application. But before accessing it, the following is the actual summary result of the deployment process :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server

    Unfortunately, although the deployment process is a success, it does not change the way to access the web application. In summary, changing the name of the war file in the specific step in the middle of the deployment as it is shown above end in failure. The following is the access attempt after the above deployment :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server

Change or Sorten the Web Application Name before the deploying process in Wildfly Application Server

Because of the failure in the previous attempt, there is a slight modification to the alternative solution. Instead of modifying in the middle of the deployment process, just do it before. So, the step for solving the problem is done before the actual deployment. In summary, the following is the actual process :

  1. Duplicate the war file which exist from the build process as follows :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  2. Rename the duplicate file into a shorter one. Rename it from ‘myproject-1.0-SNAPSHOT – Copy.war’ into ‘myproject’.  as it is available in the following image :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  3. Retry deploying again but with the renamed file as follows :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  4. Scroll it until the Next button is clearly seen as in the following image :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  5. Click the Next button to proceed the deployment. The following image will then appear :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  6. Finally, in order to finish the process, the following is the step for deploying the renamed war file. Just click the Finish button to execute the deployment process as follows :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  7. If the deployment process is a success, image of the following page will appear :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
  8. Just click the View Deployment link or click the Close button as in the above image. The following page will appear with the summary of the deployment process :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server

    Click the View Deployment link or the Close button to check the summary of the deployment process. The following is the image of it :

  9. Finally, try to access it with the renamed file name. Access it in the URL of ‘http://ip_address_server:8080/file_name’. In this context, it is ‘http://localhost:8080/myproject’ as follows :

    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server
    How to Change or to Shorten the Name of the Web Application in the Wildfly Application Server

In the end, the solution for changing the name and make it short is a success.

Leave a Reply