PrintWriter pw = new PrintWriter(resp.getOutputStream());
// Note that resp.getOutputStream() does not write to the socket; it merely buffers the entire
// output.
pw.append("<html><body>path = ");
pw.append(req.uriPath).append("<p>");
KeyValues kvs = req.getQueryComponents();
for (int i = 0; i < kvs.count; i++) {
pw.append(kvs.keys[i]).append(" = ").append(kvs.values[i]).append("<br>");
}
pw.append("</body></html>");
pw.flush();