public void close() throws IOException {
if (contextPath == null) {
super.close();
return;
}
MapPage map = new MapPage(contextPath);
String s = map.convertHtml(baos.toString());
// System.err.println("Rewrote: " + map.mapCount());
req.res.setHeader("Content-Length", "" + s.length());
OutputStream out = req.sock.getOutputStream();
out.write(s.getBytes());
out.close();