3.6. Change the Application Client-side Functionality
3.6.1. Enable LiveReload in BrowserSim
Before making changes to the my-mobile-app project, it is useful to enable LiveReload in BrowserSim. LiveReload functionality automatically updates content displayed in web browsers as the corresponding source code is modified and saved in IDE editors, making the IDE workflow more efficient. This functionality is available for all web browsers and the procedure below details how to enable LiveReload in BrowserSim.
Procedure 3.4. Enable LiveReload in BrowserSim
- In the Servers view, right-click jboss-eap-version where version denotes the JBoss EAP version, and click →.
- From the list of servers, expand Basic, select LiveReload Server and click . The LiveReload server is listed in the Servers view.
- Right-click the LiveReload Server and click .
- Right-click the BrowserSim simulated device and click . LiveReload functionality is now enabled on the simulated device and ready for use.
3.6.2. Modify index.html
The project HTML resources can be edited with the JBoss Tools HTML Editor, as demonstrated in the procedure below. With LiveReload enabled in BrowserSim, any changes to the HTML source are automatically reflected in the simulated device web browser on saving.
Procedure 3.5. Modify index.html
- In the Project Explorer view, expand my-mobile-app→src→main→webapp.
- Double-click
index.htmlto open it in the JBoss Tools HTML Editor. - Ensure the JBoss Tools HTML Editor Source tab is the tab in focus.
- Scroll through the
index.htmlfile and locate thebodytag. - Delete the following:
<p>You have successfully deployed a Java EE 6 web application.</p> <p>This quickstart demonstrates the use of various Mobile, HTML5, CSS3 and JavaScript techniques.</p> <ul id="features"> <li class="feature">Pure HTML client</li> <li class="feature">JAX-RS GET & POST end points</li> <li class="feature">HTML5 based page structure</li> <li class="feature">HTML5 form element & validation</li> <li class="feature">CSS3 selectors used for styling</li> <li class="feature">JAX-RS validation handling</li> <li class="feature">jQuery Mobile integration</li> <li class="feature">QUnit test suite to validate JavaScript</li> </ul>
- Replace the deleted code with the following:
<p>My Mobile Application!</p>
- Save the
index.htmlfile by pressing Ctrl+S. Alternatively, to save click → or click the icon. The page reloads in the BrowserSim simulated device, as a result of LiveReload being enabled, and shows the updatedindex.htmlfile.



