// This appears in Core Web Programming from // Prentice Hall Publishers, and may be freely used // or adapted. 1997 Marty Hall, hall@apl.jhu.edu. public class CgiShow { public static void main(String[] args) { CgiShow app = new CgiShow("CgiShow", args, "TEST"); app.printFile(); } protected String name; protected String[] args; protected String type; public CgiShow(String name, String[] args, String type) { this.name = name; this.args = args; this.type = type; } public void printFile() { printHeader(); printBody(args); printTrailer(); } protected void printHeader() { System.out.println ("Content-Type: text/html\n" + "\n" + "\n" + "\n" + "
\n" + "" + name + " Program" +
"