cdmvalidator/src/main/java/thredds/server/cdmvalidator/CdmValidatorController.java
public void doGet(HttpServletRequest req, HttpServletResponse res)
          throws ServletException, IOException {

    log.info("doGet(): " + UsageLog.setupRequestContext(req));

    String urlString = req.getParameter("URL");
    if (urlString == null) {
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_BAD_REQUEST, 0));
      res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Must have a URL parameter");
      return;
    }

    // validate the url String
    try {
      URI uri = new URI(urlString);
      urlString = uri.toASCIIString(); // LOOK do we want just toString() ? Is this useful "input validation" ?
    } catch (URISyntaxException e) {
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_BAD_REQUEST, 0));
      res.sendError(HttpServletResponse.SC_BAD_REQUEST, "URISyntaxException on URU parameter");
      return;
    }

    String xml = req.getParameter("xml");
    boolean wantXml = (xml != null) && xml.equals("true");

    try {
      int len = showValidatorResults(res, urlString, wantXml);
      log.info("doGet(): URL = " + urlString);
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_OK, len));

    } catch (Exception e) {
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_BAD_REQUEST, 0));
      res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid input");

    } catch (Throwable e) {
      log.error("doGet(): Validator internal error", e);
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, 0));
      res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Validator internal error");
    }

  }
public void doGet(HttpServletRequest req, HttpServletResponse res)
          throws ServletException, IOException {

    log.info("doGet(): " + UsageLog.setupRequestContext(req));

    String urlString = req.getParameter("URL");
    if (urlString == null) {
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_BAD_REQUEST, 0));
      res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Must have a URL parameter");
      return;
    }

    // validate the url String
    try {
      URI uri = new URI(urlString);
      urlString = uri.toASCIIString(); // LOOK do we want just toString() ? Is this useful "input validation" ?
    } catch (URISyntaxException e) {
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_BAD_REQUEST, 0));
      res.sendError(HttpServletResponse.SC_BAD_REQUEST, "URISyntaxException on URU parameter");
      return;
    }

    String xml = req.getParameter("xml");
    boolean wantXml = (xml != null) && xml.equals("true");

    try {
      int len = showValidatorResults(res, urlString, wantXml);
      log.info("doGet(): URL = " + urlString);
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_OK, len));

    } catch (Exception e) {
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_BAD_REQUEST, 0));
      res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid input");

    } catch (Throwable e) {
      log.error("doGet(): Validator internal error", e);
      log.info("doGet(): " + UsageLog.closingMessageForRequestContext(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, 0));
      res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Validator internal error");
    }

  }
public void doGet ( HttpServletRequest req , HttpServletResponse res ) throws ServletException , IOException { log . info ( "doGet(): " + UsageLog . setupRequestContext ( req ) ) ; String urlString = req . getParameter ( "URL" ) ; if ( urlString == null ) { log . info ( "doGet(): " + UsageLog . closingMessageForRequestContext ( HttpServletResponse . SC_BAD_REQUEST , 0 ) ) ; res . sendError ( HttpServletResponse . SC_BAD_REQUEST , "Must have a URL parameter" ) ; return ; } // validate the url String try { URI uri = new URI ( urlString ) ; urlString = uri . toASCIIString ( ) ; // LOOK do we want just toString() ? Is this useful "input validation" ? } catch ( URISyntaxException e ) { log . info ( "doGet(): " + UsageLog . closingMessageForRequestContext ( HttpServletResponse . SC_BAD_REQUEST , 0 ) ) ; res . sendError ( HttpServletResponse . SC_BAD_REQUEST , "URISyntaxException on URU parameter" ) ; return ; } String xml = req . getParameter ( "xml" ) ; boolean wantXml = ( xml != null ) && xml . equals ( "true" ) ; try { int len = showValidatorResults ( res , urlString , wantXml ) ; log . info ( "doGet(): URL = " + urlString ) ; log . info ( "doGet(): " + UsageLog . closingMessageForRequestContext ( HttpServletResponse . SC_OK , len ) ) ; } catch ( Exception e ) { log . info ( "doGet(): " + UsageLog . closingMessageForRequestContext ( HttpServletResponse . SC_BAD_REQUEST , 0 ) ) ; res . sendError ( HttpServletResponse . SC_BAD_REQUEST , "Invalid input" ) ; } catch ( Throwable e ) { log . error ( "doGet(): Validator internal error" , e ) ; log . info ( "doGet(): " + UsageLog . closingMessageForRequestContext ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR , 0 ) ) ; res . sendError ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR , "Validator internal error" ) ; } }
GET handles the case where its a remote URL (dods or http)

@param req request
@param res response
@throws javax.servlet.ServletException
@throws java.io.IOException
GET handles the case where its a remote URL ( dods or http )