Lab 3 went pretty well.  It took longer than I thought it would but they always do.  One of the things I wanted to do was write parse the XML using SAX since I’ve never actually written a SAX parser before.  SAX takes more work than using DOM and XPath but I got the experience I was looking for.

Parsing the date in the idea data took some time to get right.  I’m using Java and the Java Date API frankly sucks.  Fortunately there’s Joda Time.  Using Joda Time, I initially thought the date was in ISO 8601 format.  It’s not, but luckily putting together a custom date formatter is very easy with Joda Time.

The biggest problem I had with this lab is that when I deployed my application to to ec2, the listing service that was registered with the load balancer was spitting out XML that didn’t follow the format defined for lab2.  The XML I was getting was putting the ‘user’ and ‘technology’ attributes in the ‘request’ element and not in the ’server’ element.  I made a few small modifications to my code to display an error message when unable to properly fetch the ’server’ and ‘user’ data and everything started working just fine.

For my template framework I was using Apache Velocity but I got fed up with the poor error messages produced by Velocity.  So I switched to Freemarker and I haven’t looked back.  Freemarker has a much cleaner API than Velocity, the Freemarker template syntax has more features, and Freemarker produces error message that are actually useful.