Assignment # 5
Part b

Learning Goals

Approach

Use your Brooklyn Library html to make Ajax web service calls using jQuery. This assignment uses the Brooklyn Library Web Service you developed in Part a. In Part a you revised your html to include a card# text box. You also defined a Java class whose data included all the items in the library form and developed a serialized data structure that could be used to populate the data in the Java class. You also created data that included all the form fields for a minimum of 5 card-holders. This data is stored in your serialized file.

Steps

  1. Modify your html to include JavaScript that will bind the card# field to a jQuery hander for a blur event. The event handler is invoked when the user tabls out of the card# field.
  2. The event handler will make a GET request to the server (using jQuery) that includes the card# in the URL as a path parameter.
  3. Your server's Get service method will handle this request and access your serialized file.
  4. If your Get servce method identifies a matching record in the serailized file (or a local copy of the file), return the complete set of data for the matching card as a string of Json.
  5. If it is not contained in the data structure, return an empty string.
  6. Using jQuery, populate the fields of your form with the data in the Json string.

Hints