reDirect += "contents.html";
    public void doGet(HttpServletRequest request,                      HttpServletResponse response)            throws IOException, ServletException {        // response.setHeader("Last-Modified", (new Date()).toString() );        try {            if (Debug.isSet("probeRequest"))                Util.probeRequest(System.out, this, request, getServletContext(), getServletConfig());            synchronized (syncLock) {                long reqno = HitCounter++;                if (Debug.isSet("showRequest")) {                    showRequest(request, reqno);                }            } // synch            String dataSource = ReqInfo.getDataSource(request);            String dataSetName = ReqInfo.getDataSetName(request);            String requestSuffix = ReqInfo.getRequestSuffix(request);            boolean specialRequest = false;            if (dataSource != null) {                if (        // Version Response?                        dataSource.equalsIgnoreCase("/version")                        ) {                    odh.sendVersion(request, response);                    log.info("Sent Version Response");                    specialRequest = true;                } else if ( // Help Response?                        dataSource.equalsIgnoreCase("/help") ||                                dataSource.equalsIgnoreCase("/help/") ||                                ((requestSuffix != null) &&                                requestSuffix.equalsIgnoreCase("help"))                        ) {                    odh.sendHelpPage(request, response);                    log.info("Sent Help Page");                    specialRequest = true;                } else if ( // System Properties Response?                    //Debug.isSet("SystemProperties") &&                        dataSource.equalsIgnoreCase("/systemproperties")                        ) {                    Util.sendSystemProperties(request, response, odh);                    log.info("Sent System Properties");                    specialRequest = true;                } else if (    // Debug response?                        Debug.isSet("DebugInterface") &&                                dataSource.equals("/debug") &&                                (requestSuffix != null) &&                                requestSuffix.equals("")) {                    DebugHandler.doDebug(this, request, response, odh, this.getServletConfig());                    log.info("Sent Debug Response");                    specialRequest = true;                } else if (  // Status Response?                        dataSource.equalsIgnoreCase("/status")                        ) {                    doGetStatus(request, response);                    log.info("Sent Status");                    specialRequest = true;                }            }            if (!specialRequest) {                if ( // Implied Directory request?                        dataSource == null ||                                dataSource.equals("/") ||                                dataSource.equals("") ||                                dataSource.endsWith("/") ||                                requestSuffix.equals("")                        ) {                    String reDirect = request.getRequestURI();                    //System.out.println("redirect: "+redirect);                    if (!reDirect.endsWith("/"))                        reDirect = reDirect + "/";                    //System.out.println("redirect: "+redirect);                    if (odh.useOpendapDirectoryView()) {                        reDirect += "contents.html";                        odh.sendDir(request, response);                    }                    else {                        reDirect += "catalog.html";                        getThreddsCatalog(request, response);                    }                    //System.out.println("redirect: "+redirect);                    //response.sendRedirect(reDirect);                    //log.info("Sent Redirect To: " + reDirect);                } else if ( //  Directory response?                        dataSetName.equalsIgnoreCase("contents") &&                        requestSuffix.equalsIgnoreCase("html")) {                    odh.sendDir(request, response);                    log.info("Sent Contents (aka OPeNDAP directory).");                } else if ( //  THREDDS Catalog ?                        getThreddsCatalog(request, response)) {                    log.info("Sent Catalog");                } else if ( // DDS Response?                        requestSuffix.equalsIgnoreCase("dds")                        ) {                    odh.sendDDS(request, response);                    log.info("Sent DDS");                } else if ( // DAS Response?                        requestSuffix.equalsIgnoreCase("das")                        ) {                    odh.sendDAS(request, response);                    log.info("Sent DAS");                } else if (  // DDX Response?                        requestSuffix.equalsIgnoreCase("ddx")                        ) {                    odh.sendDDX(request, response);                    log.info("Sent DDX");                } else if ( // Blob Response?                        requestSuffix.equalsIgnoreCase("blob")                        ) {                    //doGetBLOB(request, response, rs);                    badURL(request, response);                    log.info("Sent BAD URL Response because they asked for a Blob. Bad User!");                } else if ( // DataDDS (aka .dods) Response?                        requestSuffix.equalsIgnoreCase("dods")                        ) {                    odh.sendDODS(request, response);                    log.info("Sent DAP2 Data");                } else if (  // ASCII Data Response.                        requestSuffix.equalsIgnoreCase("asc") ||                                requestSuffix.equalsIgnoreCase("ascii")                        ) {                    odh.sendASCII(request, response);                    log.info("Sent ASCII");                } else if (  // Info Response?                        requestSuffix.equalsIgnoreCase("info")                        ) {                    odh.sendInfo(request, response);                    log.info("Sent Info");                } else if (  //HTML Request Form (aka The Interface From Hell) Response?                        requestSuffix.equalsIgnoreCase("html") ||                                requestSuffix.equalsIgnoreCase("htm")                        ) {                    odh.sendHTMLRequestForm(request, response);                    log.info("Sent HTML Request Form");                } else if (requestSuffix.equals("")) {                    badURL(request, response);                    log.info("Sent BAD URL (missing Suffix)");                } else {                    badURL(request, response);                    log.info("Sent BAD URL - nothing left to check.");                }            }        } catch (Throwable e) {            OPeNDAPException.anyExceptionHandler(e, response);        }    }