4.7.1 The task

For this exercise you will work in pairs. There have been a number of studies that have shown that two people working together on a single terminal can develop code faster and more effectively than people working on their own. By constantly reviewing the code as it is being written, ideas are tested and developed faster with less bugs.

Your task is to develop a command line application which will take in a surname and returns the details from the sussex university directory. The URL you will use is http://www.susx.ac.uk/central/people.shtml.

You should proceed as follows:

  1. Study the html source to understand what url the form posts to, and what the various parameters should be.
  2. Develop the URL from java.net.URL and java.net.URLConnection. which will make the call. Show the received html to the screen initially.
  3. Use the java.util.regex package to filter all except for the relevant information from the received html.
  4. Sit back and reflect that it would be far nicer if the information returned from web services was separated out from how it was presented. And then go read about xml, xslt and friends.

Ian Wakeman 2005-02-22