3.7. Change the Application Server-side Functionality

3.7.1. Modify Member.java

The Java resources can be edited with the IDE Java Editor, as demonstrated in the procedure below. Despite LiveReload being enabled in BrowserSim, these changes are not reflected until the application is republished to the server.

Procedure 3.6. Modify Member.java

  1. In the Project Explorer view, expand Java Resourcessrc/main/javacom.company.example.mymobileapp.model.
  2. Double-click Member.java to open it in the IDE Java Editor.
    Description

    Figure 3.13. Member.java File Opened in the IDE Java Editor

  3. Scroll through the Member.java file and locate the following code:
    @NotNull
    @Size(min = 10, max = 12, message = "10-12 Numbers")
    @Digits(fraction = 0, integer = 12, message = "Not valid")
    @Column(name = "phone_number")
    private String phoneNumber;
  4. Replace min = 10 with min = 6.
  5. Save the Member.java file.

3.7.2. Republish the Application

You must republish the application to the JBoss EAP server in order to see the Member.java changes reflected in the BrowserSim simulated device web browser, as detailed here.
To republish the application, in the Servers view, right-click my-mobile-app and click Full Publish. The JBoss EAP server republishes the application and, once complete, the Console view displays the following:
Replaced deployment "my-mobile-app.war" with deployment "my-mobile-app.war"
To test the changes made to the Member.java file, in the simulated device web browser, in the Phone # field type a six digit number. You do not see the phone # should be minimum 10 and maximum 12 digits error message, indicating that you are viewing the updated running version of the application.
Description

Figure 3.14. No Validation Message Shown for the Entered Six-digit Phone Number