response.setHeader("XDODS-Server", rs.getXDODSServer()); response.setHeader("XOPeNDAP-Server", rs.getXOPeNDAPServer()); response.setHeader("XDAP", rs.getXDAP(request));
response.setHeader("XDODS-Server", odh.getXDODSServerVersion()); response.setHeader("XOPeNDAP-Server", odh.getXOPeNDAPServerVersion()); response.setHeader("XDAP", odh.getXDAPVersion(request));
    public static void doDebug(HttpServlet servlet, HttpServletRequest request,                               HttpServletResponse response,                               ReqState rs) throws IOException {        response.setContentType("text/html");        response.setHeader("XDODS-Server", rs.getXDODSServer());        response.setHeader("XOPeNDAP-Server", rs.getXOPeNDAPServer());        response.setHeader("XDAP", rs.getXDAP(request));        response.setHeader("Content-Description", "dods_debug");        PrintStream pw = new PrintStream(response.getOutputStream());        pw.println("<title>Debugging</title>");        pw.println("<body><pre>");        StringTokenizer tz = new StringTokenizer(rs.getConstraintExpression(), "=;");        while (tz.hasMoreTokens()) {            String cmd = tz.nextToken();            pw.println("Cmd= " + cmd);            if (cmd.equals("help")) {                pw.println(" help;log;logEnd;logShow");                pw.println(" showFlags;showInitParameters;showRequest");                pw.println(" on|off=(flagName)");                doDebugCmd(cmd, tz, pw); // for subclasses            } else if (cmd.equals("log")) {                Log.reset();                pw.println(" logging started");            } else if (cmd.equals("logEnd")) {                Log.close();                pw.println(" logging ended");            } else if (cmd.equals("logShow")) {                pw.println(Log.getContents());                pw.println("-----done logShow");            } else if (cmd.equals("on"))                Debug.set(tz.nextToken(), true);            else if (cmd.equals("off"))                Debug.set(tz.nextToken(), false);            else if (cmd.equals("showFlags")) {                Iterator iter = Debug.keySet().iterator();                while (iter.hasNext()) {                    String key = (String) iter.next();                    pw.println("  " + key + " " + Debug.isSet(key));                }            } else if (cmd.equals("showInitParameters")) {                pw.println(rs.toString());            } else if (cmd.equals("showRequest")) {                ServletUtil.probeRequest(pw, request, servlet.getServletContext(), servlet.getServletConfig());            } else if (!doDebugCmd(cmd, tz, pw)) { // for subclasses                pw.println("  unrecognized command");            }        }        pw.println("--------------------------------------");        pw.println("Logging is " + (Log.isOn() ? "on" : "off"));        Iterator iter = Debug.keySet().iterator();        while (iter.hasNext()) {            String key = (String) iter.next();            boolean val = Debug.isSet(key);            if (val)                pw.println("  " + key + " " + Debug.isSet(key));        }        pw.println("</pre></body>");        pw.flush();        response.setStatus(HttpServletResponse.SC_OK);    }