opendap/src/main/java/opendap/servlet/GetHTMLInterfaceHandler.java
public void sendDataRequestForm(ReqState rs,
                                    String dataSet,
                                    ServerDDS sdds,
                                    DAS myDAS) // changed jc
            throws DAP2Exception, ParseException {


        if (_Debug) System.out.println("Sending DODS Data Request Form For: " + dataSet +
                "    CE: '" + rs.getRequest().getQueryString() + "'");
        String requestURL;

/*
        // Turn this on later if we discover we're supposed to accept
        // constraint expressions as input to the Data Request Web Form
    String ce;
    if(request.getQueryString() == null){
        ce = "";
        }
    else {
        ce = "?" + request.getQueryString();
        }
*/


        int suffixIndex = rs.getRequest().getRequestURL().toString().lastIndexOf(".");

        requestURL = rs.getRequest().getRequestURL().substring(0, suffixIndex);

        String dapCssUrl = "/" + requestURL.split("/",5)[3] + "/" + "tdsDap.css";
        

        try {

            //PrintWriter pw = new PrintWriter(response.getOutputStream());
            PrintWriter pw;
            if (false) {
                pw = new PrintWriter(
                        new FileOutputStream(
                                new File("debug.html")
                        )
                );
            } else
                pw = new PrintWriter(new OutputStreamWriter(rs.getResponse().getOutputStream(),Util.UTF8));


            wwwOutPut wOut = new wwwOutPut(pw);

            // Get the DDS and the DAS (if one exists) for the dataSet.
            DDS myDDS = getWebFormDDS(dataSet, sdds);
            //DAS myDAS = dServ.getDAS(dataSet); // change jc

            jscriptCore jsc = new jscriptCore();

            pw.println(
                    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n"
                            + "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
                            + "<html><head><title>OPeNDAP Dataset Query Form</title>\n"
                            + "<link type=\"text/css\" rel=\"stylesheet\" media=\"screen\" href=\"" + dapCssUrl + "\"/>\n"
                            + "<base href=\"" + helpLocation + "\">\n"
                            + "<script type=\"text/javascript\">\n"
                            + "<!--\n"
            );
            pw.flush();

            pw.println(jsc.jScriptCode);
            pw.flush();

            pw.println(
                    "DODS_URL = new dods_url(\"" + requestURL + "\");\n"
                            + "// -->\n"
                            + "</script>\n"
                            + "</head>\n"
                            + "<body>\n"
                            + "<p><h2 align='center'>OPeNDAP Dataset Access Form</h2>\n"
                            + "<hr>\n"
                            + "<form action=\"\">\n"
                            + "<table>\n"
            );
            pw.flush();

            wOut.writeDisposition(requestURL);
            pw.println("<tr><td><td><hr>\n");

            wOut.writeGlobalAttributes(myDAS, myDDS);
            pw.println("<tr><td><td><hr>\n");

            wOut.writeVariableEntries(myDAS, myDDS);
            pw.println("</table></form>\n");
            pw.println("<hr>\n");


            pw.println(
                    "<address>Send questions or comments to: "
                            + "<a href=\"mailto:support@unidata.ucar.edu\">"
                            + "support@unidata.ucar.edu"
                            + "</a></address>"
                            + "</body></html>\n"
            );

            pw.println("<hr>");
            pw.println("<h2>DDS:</h2>");

            pw.println("<pre>");
            myDDS.print(pw);
            pw.println("</pre>");
            pw.println("<hr>");
            pw.flush();


        }
        catch (IOException ioe) {
            System.out.println("OUCH! IOException: " + ioe.getMessage());
            ioe.printStackTrace(System.out);
        }


    }
public void sendDataRequestForm(ReqState rs,
                                    String dataSet,
                                    ServerDDS sdds,
                                    DAS myDAS) // changed jc
            throws DAP2Exception, ParseException {


        if (_Debug) System.out.println("Sending DODS Data Request Form For: " + dataSet +
                "    CE: '" + rs.getRequest().getQueryString() + "'");
        String requestURL;

/*
        // Turn this on later if we discover we're supposed to accept
        // constraint expressions as input to the Data Request Web Form
    String ce;
    if(request.getQueryString() == null){
        ce = "";
        }
    else {
        ce = "?" + request.getQueryString();
        }
*/


        int suffixIndex = rs.getRequest().getRequestURL().toString().lastIndexOf(".");

        requestURL = rs.getRequest().getRequestURL().substring(0, suffixIndex);

        String dapCssUrl = "/" + requestURL.split("/",5)[3] + "/" + "tdsDap.css";
        

        try {

            //PrintWriter pw = new PrintWriter(response.getOutputStream());
            PrintWriter pw;
            if (false) {
                pw = new PrintWriter(
                        new FileOutputStream(
                                new File("debug.html")
                        )
                );
            } else
                pw = new PrintWriter(new OutputStreamWriter(rs.getResponse().getOutputStream(),Util.UTF8));


            wwwOutPut wOut = new wwwOutPut(pw);

            // Get the DDS and the DAS (if one exists) for the dataSet.
            DDS myDDS = getWebFormDDS(dataSet, sdds);
            //DAS myDAS = dServ.getDAS(dataSet); // change jc

            jscriptCore jsc = new jscriptCore();

            pw.println(
                    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n"
                            + "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
                            + "<html><head><title>OPeNDAP Dataset Query Form</title>\n"
                            + "<link type=\"text/css\" rel=\"stylesheet\" media=\"screen\" href=\"" + dapCssUrl + "\"/>\n"
                            + "<base href=\"" + helpLocation + "\">\n"
                            + "<script type=\"text/javascript\">\n"
                            + "<!--\n"
            );
            pw.flush();

            pw.println(jsc.jScriptCode);
            pw.flush();

            pw.println(
                    "DODS_URL = new dods_url(\"" + requestURL + "\");\n"
                            + "// -->\n"
                            + "</script>\n"
                            + "</head>\n"
                            + "<body>\n"
                            + "<p><h2 align='center'>OPeNDAP Dataset Access Form</h2>\n"
                            + "<hr>\n"
                            + "<form action=\"\">\n"
                            + "<table>\n"
            );
            pw.flush();

            wOut.writeDisposition(requestURL);
            pw.println("<tr><td><td><hr>\n");

            wOut.writeGlobalAttributes(myDAS, myDDS);
            pw.println("<tr><td><td><hr>\n");

            wOut.writeVariableEntries(myDAS, myDDS);
            pw.println("</table></form>\n");
            pw.println("<hr>\n");


            pw.println(
                    "<address>Send questions or comments to: "
                            + "<a href=\"mailto:support@unidata.ucar.edu\">"
                            + "support@unidata.ucar.edu"
                            + "</a></address>"
                            + "</body></html>\n"
            );

            pw.println("<hr>");
            pw.println("<h2>DDS:</h2>");

            pw.println("<pre>");
            myDDS.print(pw);
            pw.println("</pre>");
            pw.println("<hr>");
            pw.flush();


        }
        catch (IOException ioe) {
            System.out.println("OUCH! IOException: " + ioe.getMessage());
            ioe.printStackTrace(System.out);
        }


    }
public void sendDataRequestForm ( ReqState rs , String dataSet , ServerDDS sdds , DAS myDAS ) // changed jc
 throws DAP2Exception , ParseException { if ( _Debug ) System . out . println ( "Sending DODS Data Request Form For: " + dataSet + "    CE: '" + rs . getRequest ( ) . getQueryString ( ) + "'" ) ; String requestURL ; /*
        // Turn this on later if we discover we're supposed to accept
        // constraint expressions as input to the Data Request Web Form
    String ce;
    if(request.getQueryString() == null){
        ce = "";
        }
    else {
        ce = "?" + request.getQueryString();
        }
*/ int suffixIndex = rs . getRequest ( ) . getRequestURL ( ) . toString ( ) . lastIndexOf ( "." ) ; requestURL = rs . getRequest ( ) . getRequestURL ( ) . substring ( 0 , suffixIndex ) ; String dapCssUrl = "/" + requestURL . split ( "/" , 5 ) [ 3 ] + "/" + "tdsDap.css" ; try { //PrintWriter pw = new PrintWriter(response.getOutputStream());
 PrintWriter pw ; if ( false ) { pw = new PrintWriter ( new FileOutputStream ( new File ( "debug.html" ) ) ) ; } else pw = new PrintWriter ( new OutputStreamWriter ( rs . getResponse ( ) . getOutputStream ( ) , Util . UTF8 ) ) ; wwwOutPut wOut = new wwwOutPut ( pw ) ; // Get the DDS and the DAS (if one exists) for the dataSet.
 DDS myDDS = getWebFormDDS ( dataSet , sdds ) ; //DAS myDAS = dServ.getDAS(dataSet); // change jc
 jscriptCore jsc = new jscriptCore ( ) ; pw . println ( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n" + "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n" + "<html><head><title>OPeNDAP Dataset Query Form</title>\n" + "<link type=\"text/css\" rel=\"stylesheet\" media=\"screen\" href=\"" + dapCssUrl + "\"/>\n" + "<base href=\"" + helpLocation + "\">\n" + "<script type=\"text/javascript\">\n" + "<!--\n" ) ; pw . flush ( ) ; pw . println ( jsc . jScriptCode ) ; pw . flush ( ) ; pw . println ( "DODS_URL = new dods_url(\"" + requestURL + "\");\n" + "// -->\n" + "</script>\n" + "</head>\n" + "<body>\n" + "<p><h2 align='center'>OPeNDAP Dataset Access Form</h2>\n" + "<hr>\n" + "<form action=\"\">\n" + "<table>\n" ) ; pw . flush ( ) ; wOut . writeDisposition ( requestURL ) ; pw . println ( "<tr><td><td><hr>\n" ) ; wOut . writeGlobalAttributes ( myDAS , myDDS ) ; pw . println ( "<tr><td><td><hr>\n" ) ; wOut . writeVariableEntries ( myDAS , myDDS ) ; pw . println ( "</table></form>\n" ) ; pw . println ( "<hr>\n" ) ; pw . println ( "<address>Send questions or comments to: " + "<a href=\"mailto:support@unidata.ucar.edu\">" + "support@unidata.ucar.edu" + "</a></address>" + "</body></html>\n" ) ; pw . println ( "<hr>" ) ; pw . println ( "<h2>DDS:</h2>" ) ; pw . println ( "<pre>" ) ; myDDS . print ( pw ) ; pw . println ( "</pre>" ) ; pw . println ( "<hr>" ) ; pw . flush ( ) ; } catch ( IOException ioe ) { System . out . println ( "OUCH! IOException: " + ioe . getMessage ( ) ) ; ioe . printStackTrace ( System . out ) ; } }
************************************************************************
Default handler for OPeNDAP .html requests. Returns an html form
and javascript code that allows the user to use their browser
to select variables and build constraints for a data request.
The DDS and DAS for the data set are used to build the form. The
types in opendap.servlet.www are integral to the form generation.

@param rs  The <code>ReqState</code> from the client.
@param dataSet
@param sdds
@param myDAS
@throws opendap.dap.DAP2Exception
@throws ParseException
@see opendap.servlet.www.wwwFactory
************************************************************************ Default handler for OPeNDAP . html requests . Returns an html form and javascript code that allows the user to use their browser to select variables and build constraints for a data request . The DDS and DAS for the data set are used to build the form . The types in opendap . servlet . www are integral to the form generation .