Develop the Mock User Interface
Explore how to develop a mock user interface using JSP and JavaScript that interacts with a mock service to manage one-to-many unidirectional relationships. Learn to implement key UI features such as loading data grids, creating and updating person records with multiple phone numbers, and managing dynamic input controls for phone entries.
Now that we have seen how to write the mock service with an in-memory database, let’s write the user interface that will use this mock service. The user interface will have the means to add, edit, delete, and show all records related to the Person, including the phone numbers. A screenshot of the user interface is shown in Figure 6-2.
JSP page
The JSP body is the page that is initially loaded. After that, the JavaScript actions are called. We will start with the JSP fragment and then follow it with the JavaScript functions.
loadObjects method
First, look at the JavaScript ...