opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java
public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
    {

        log.debug("DTS doGet()");

        long tid = Thread.currentThread().getId();
        log.debug("thread=" + tid);

        // setHeader("Last-Modified", (new Date()).toString() );

        boolean isDebug = false;
        ReqState rs = null;
        RequestDebug reqD = null;
        try {
//      if(Debug.isSet("probeRequest"))
//        probeRequest(System.out, rs);

            rs = getRequestState(request, response);
            assert (rs != null);
            if(rs != null) {
                String ds = rs.getDataSet();
                String suff = rs.getRequestSuffix();
                isDebug = ((ds != null) && ds.equals("debug") && (suff != null) && suff.equals(""));
            }

            synchronized (syncLock) {

                if(!isDebug) {
                    long reqno = HitCounter++;
                    if(track) {
                        reqD = new RequestDebug(reqno, Thread.currentThread().toString());
                        rs.setUserObject(reqD);
                        if(prArr == null) prArr = new ArrayList(10000);
                        prArr.add((int) reqno, rs);
                    }

                    if(Debug.isSet("showRequest")) {
                        log.debug("-------------------------------------------");
                        log.debug("Server: " + getServerName() + "   Request #" + reqno);
                        log.debug("Client: " + request.getRemoteHost());
                        log.debug(rs.toString());
                        log.debug("Request dataset: '" + rs.getDataSet() + "' suffix: '" + rs.getRequestSuffix() +
                                "' CE: '" + rs.getConstraintExpression() + "'");
                    }
                }
            } // synch

            if(rs != null) {
                String dataSet = rs.getDataSet();
                String requestSuffix = rs.getRequestSuffix();
                rs.getResponse().setHeader("XDODS-Server", getServerVersion());// Make sure always set


                if(dataSet == null || dataSet.equals("/") || dataSet.equals("")) {
                    doGetDIR(rs);
                } else if(dataSet.equalsIgnoreCase("/version") || dataSet.equalsIgnoreCase("/version/")) {
                    doGetVER(rs);
                } else if(dataSet.equalsIgnoreCase("/help") || dataSet.equalsIgnoreCase("/help/")) {
                    doGetHELP(rs);
                } else if(dataSet.equalsIgnoreCase("/" + requestSuffix)) {
                    doGetHELP(rs);
                } else if(requestSuffix.equalsIgnoreCase("dds")) {
                    doGetDDS(rs);
                } else if(requestSuffix.equalsIgnoreCase("das")) {
                    doGetDAS(rs);
                } else if(requestSuffix.equalsIgnoreCase("ddx")) {
                    doGetDDX(rs);
                } else if(requestSuffix.equalsIgnoreCase("blob")) {
                    doGetBLOB(rs);
                } else if(requestSuffix.equalsIgnoreCase("dods")) {
                    doGetDAP2Data(rs);
                } else if(requestSuffix.equalsIgnoreCase("asc") ||
                        requestSuffix.equalsIgnoreCase("ascii")) {
                    doGetASC(rs);
                } else if(requestSuffix.equalsIgnoreCase("info")) {
                    doGetINFO(rs);
                } else if(requestSuffix.equalsIgnoreCase("html") || requestSuffix.equalsIgnoreCase("htm")) {
                    doGetHTML(rs);
                } else if(requestSuffix.equalsIgnoreCase("ver") || requestSuffix.equalsIgnoreCase("version")) {
                    doGetVER(rs);
                } else if(requestSuffix.equalsIgnoreCase("help")) {
                    doGetHELP(rs);

        /* JC added
        } else if(dataSet.equalsIgnoreCase("catalog") && requestSuffix.equalsIgnoreCase("xml")) {
          doGetCatalog(rs);
        } else if(dataSet.equalsIgnoreCase("status")) {
          doGetStatus(rs);
        } else if(dataSet.equalsIgnoreCase("systemproperties")) {
          doGetSystemProps(rs);
        } else if(isDebug) {
          doDebug(rs);  */
                } else if(requestSuffix.equals("")) {
                    badURL(request, response);
                } else {
                    badURL(request, response);
                }
            } else {// rs == null
                badURL(request, response);
            }

            if(reqD != null) reqD.done = true;
        } catch (Throwable e) {
            anyExceptionHandler(e, rs);
        }

    }
public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
    {

        log.debug("DTS doGet()");

        long tid = Thread.currentThread().getId();
        log.debug("thread=" + tid);

        // setHeader("Last-Modified", (new Date()).toString() );

        boolean isDebug = false;
        ReqState rs = null;
        RequestDebug reqD = null;
        try {
//      if(Debug.isSet("probeRequest"))
//        probeRequest(System.out, rs);

            rs = getRequestState(request, response);
            assert (rs != null);
            if(rs != null) {
                String ds = rs.getDataSet();
                String suff = rs.getRequestSuffix();
                isDebug = ((ds != null) && ds.equals("debug") && (suff != null) && suff.equals(""));
            }

            synchronized (syncLock) {

                if(!isDebug) {
                    long reqno = HitCounter++;
                    if(track) {
                        reqD = new RequestDebug(reqno, Thread.currentThread().toString());
                        rs.setUserObject(reqD);
                        if(prArr == null) prArr = new ArrayList(10000);
                        prArr.add((int) reqno, rs);
                    }

                    if(Debug.isSet("showRequest")) {
                        log.debug("-------------------------------------------");
                        log.debug("Server: " + getServerName() + "   Request #" + reqno);
                        log.debug("Client: " + request.getRemoteHost());
                        log.debug(rs.toString());
                        log.debug("Request dataset: '" + rs.getDataSet() + "' suffix: '" + rs.getRequestSuffix() +
                                "' CE: '" + rs.getConstraintExpression() + "'");
                    }
                }
            } // synch

            if(rs != null) {
                String dataSet = rs.getDataSet();
                String requestSuffix = rs.getRequestSuffix();
                rs.getResponse().setHeader("XDODS-Server", getServerVersion());// Make sure always set


                if(dataSet == null || dataSet.equals("/") || dataSet.equals("")) {
                    doGetDIR(rs);
                } else if(dataSet.equalsIgnoreCase("/version") || dataSet.equalsIgnoreCase("/version/")) {
                    doGetVER(rs);
                } else if(dataSet.equalsIgnoreCase("/help") || dataSet.equalsIgnoreCase("/help/")) {
                    doGetHELP(rs);
                } else if(dataSet.equalsIgnoreCase("/" + requestSuffix)) {
                    doGetHELP(rs);
                } else if(requestSuffix.equalsIgnoreCase("dds")) {
                    doGetDDS(rs);
                } else if(requestSuffix.equalsIgnoreCase("das")) {
                    doGetDAS(rs);
                } else if(requestSuffix.equalsIgnoreCase("ddx")) {
                    doGetDDX(rs);
                } else if(requestSuffix.equalsIgnoreCase("blob")) {
                    doGetBLOB(rs);
                } else if(requestSuffix.equalsIgnoreCase("dods")) {
                    doGetDAP2Data(rs);
                } else if(requestSuffix.equalsIgnoreCase("asc") ||
                        requestSuffix.equalsIgnoreCase("ascii")) {
                    doGetASC(rs);
                } else if(requestSuffix.equalsIgnoreCase("info")) {
                    doGetINFO(rs);
                } else if(requestSuffix.equalsIgnoreCase("html") || requestSuffix.equalsIgnoreCase("htm")) {
                    doGetHTML(rs);
                } else if(requestSuffix.equalsIgnoreCase("ver") || requestSuffix.equalsIgnoreCase("version")) {
                    doGetVER(rs);
                } else if(requestSuffix.equalsIgnoreCase("help")) {
                    doGetHELP(rs);

        /* JC added
        } else if(dataSet.equalsIgnoreCase("catalog") && requestSuffix.equalsIgnoreCase("xml")) {
          doGetCatalog(rs);
        } else if(dataSet.equalsIgnoreCase("status")) {
          doGetStatus(rs);
        } else if(dataSet.equalsIgnoreCase("systemproperties")) {
          doGetSystemProps(rs);
        } else if(isDebug) {
          doDebug(rs);  */
                } else if(requestSuffix.equals("")) {
                    badURL(request, response);
                } else {
                    badURL(request, response);
                }
            } else {// rs == null
                badURL(request, response);
            }

            if(reqD != null) reqD.done = true;
        } catch (Throwable e) {
            anyExceptionHandler(e, rs);
        }

    }
Handles incoming requests from clients. Parses the request and determines
what kind of OPeNDAP response the client is requesting. If the request is
understood, then the appropriate handler method is called, otherwise
an error is returned to the client.
<p>
This method is the entry point for <code>DTSServlet</code>.

@param request  The client's <code> HttpServletRequest</code> request
object.
@param response The server's <code> HttpServletResponse</code> response
object.
@see opendap.servlet.ReqState