Landing : Athabascau University

Assignment 2 Reflection

  • Public
By Brent Beaudry December 30, 2021 - 5:05pm

This assignment for me was a little more difficult, but no overly so. I had a trouble at first with formatting the logging, but I got it eventally. I started with SingleFileHTTPServer as instructed, but I found myself using more and more JHTTP code fragments to replace what was used in SingleFileHTTPServer. It was interesting to not the differences between the two programs, and I learned a lot going through the exercise. In th end, I found that I had basically transformed SingleFileHTTPServer into something that actually very closely resembles JHTTP. I did have one problem that I wasn't able to correctly solve with the logging format - getting the header code (eg. "200") and the amount of bytes transferred out of the code into the log file. I could display the proper values using sysout on the console, but couldn't figure out the missing llink to get them into the log. I know I was overlooking something very obvious.... Also, I don't know if anyone else experienced this, but I ended up with a separate class to handle the content (basically RequestProcessor)  - compiling this class separately from the main class caused problems - closing ports, etc so the attachments woudn't refresh properly in the browser. If I made a change to the handler class, I had to re-compile the main class to preserve proper functionality. Interesting exercise, for sure, and this one ended up taking the longest (I proresssed through the course materials and started (and completed!) Assignment 3 and started Assignmet 4 before submitting this Assignment.