// If the client says "format=object" then
// send the Date as a serialized object
if ("object".equals(req.getParameter("format"))) {
ObjectOutputStream out = new ObjectOutputStream(res.getOutputStream());
out.writeObject(getDate());
}
// Otherwise send the Date as a normal ASCII string
else {
PrintWriter out = res.getWriter();
out.println(getDate().toString());
}