This is the fourth project of the semester.
You are to define at least three Java classes to represent objects stored on the server. The classes should implement an interface like the following:
For example, a Person class which implements CustomSerializable might be encoded as follows:
To implement the toJSON, toXML, and toHTML methods, I would recommend using Java's StringBuilder class. You don't need to use any special library to automate the serialization; just write out the strings by hand.
Then implement a Java servlet that accepts GET request parameters. Your request URI might look like /project4/Serializer?what=Person&format=JSON for example. Based on the parameters passed to the servlet, instantiate an object of the corresponding class, initialize the object with values, and write the object back to the client in the requested format. In other words, your servlet must return JSON, XML, and HTML when asked.
Additionally, have your Servlet spit out links (in an HTML page) to all of the above combinations of GET requests whenever an invalid request is made to the servlet. For example, you might display: