Reference Guide

Table Of Contents
Now add a break point and verify that the controller stops at that point. You may skip the rest of
this information if familiar with Eclipse’s debug perspective. Use the application developed on
page 126 at the point of section GUI-Specific REST API on page 204. The reason to do so is
because at that point, the application generates a very simple user interface with a single button
that displays a message retrieved from the server via RESTful web services; and this adds a
breakpoint in that REST API. You may not be able to follow the remaining of this section using such
application in that particular state, however you can follow the section just by adding a break
point in any code that is executed in the controller (Which is any Java code in your application);
you just need to figure out an action that triggers the code you want to remotely debug.
Open a Java file and add a break point. Following the sample application we will open the REST
API used by the GUI, SwitchResource from module hm-ui, and add a break point in the only
RESTful method there as illustrated in Figure 73.
Figure 73 Adding Break Point to SwitchViewResource.java
Figure 1
Now open the application and click on the Refresh DeviceHealth button that displays a message
retrieved from the REST API where the break point was just added. Figu re 74 shows the sample
application’s view. After clicking Refresh DeviceHealth, notice that a confirmation message from
Eclipse requesting to change to the debug perspective, Figure 75. That means the controller hit the
break point and now it can run step by step. Select Yes to continue.
234