bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java
private void genPreambleMethods() throws JasperException {
        // Method used to get compile time file dependencies
        out.printil("public java.util.List<String> getDependants() {");
        out.pushIndent();
        out.printil("return _jspx_dependants;");
        out.popIndent();
        out.printil("}");
        out.println();

        // Method to get bytes from String
        if (genBytes) {
            out.printil("private static byte[] _jspx_getBytes(String s) {");
            out.pushIndent();
            out.printil("try {");
            out.pushIndent();
            out.printil("return s.getBytes(_jspx_encoding);");
            out.popIndent();
            out.printil("} catch (java.io.UnsupportedEncodingException ex) {");
            out.printil("}");
            out.printil("return null;");
            out.popIndent();
            out.printil("}");
            out.println();

            // Generate code to see if the response encoding has been set
            // differently from the encoding declared in the page directive.
            // Note that we only need to do the test once.  The assumption
            // is that the encoding cannot be changed once some data has been
            // written.
            out.printil("private boolean _jspx_same_encoding(String encoding) {");
            out.pushIndent();
            out.printil("if (! _jspx_encoding_tested) {");
            out.pushIndent();
            out.printil("_jspx_gen_bytes = _jspx_encoding.equals(encoding);");
            out.printil("_jspx_encoding_tested = true;");
            out.popIndent();
            out.printil("}");
            out.printil("return _jspx_gen_bytes;");
            out.popIndent();
            out.printil("}");
            out.println();
        }

        generateTagHandlerInit();
        generateTagHandlerDestroy();
    }
private void genPreambleMethods() throws JasperException {
        // Method used to get compile time file dependencies
        out.printil("public java.util.List<String> getDependants() {");
        out.pushIndent();
        out.printil("return _jspx_dependants;");
        out.popIndent();
        out.printil("}");
        out.println();

        // Method to get bytes from String
        if (genBytes) {
            out.printil("private static byte[] _jspx_getBytes(String s) {");
            out.pushIndent();
            out.printil("try {");
            out.pushIndent();
            out.printil("return s.getBytes(_jspx_encoding);");
            out.popIndent();
            out.printil("} catch (java.io.UnsupportedEncodingException ex) {");
            out.printil("}");
            out.printil("return null;");
            out.popIndent();
            out.printil("}");
            out.println();

            // Generate code to see if the response encoding has been set
            // differently from the encoding declared in the page directive.
            // Note that we only need to do the test once.  The assumption
            // is that the encoding cannot be changed once some data has been
            // written.
            out.printil("private boolean _jspx_same_encoding(String encoding) {");
            out.pushIndent();
            out.printil("if (! _jspx_encoding_tested) {");
            out.pushIndent();
            out.printil("_jspx_gen_bytes = _jspx_encoding.equals(encoding);");
            out.printil("_jspx_encoding_tested = true;");
            out.popIndent();
            out.printil("}");
            out.printil("return _jspx_gen_bytes;");
            out.popIndent();
            out.printil("}");
            out.println();
        }

        generateTagHandlerInit();
        generateTagHandlerDestroy();
    }
Declare general-purpose methods
(shared by servlet and tag handler preamble generation)