/* * FastCGI example program using Java Standard I/O * * * Copyright (c) 1996 Open Market, Inc. * * See the file "LICENSE.TERMS" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ import FCGIInterface; import FCGIGlobalDefs; import java.io.*; class EchoFCGI { public static void main (String args[]) { int status = 0; while(new FCGIInterface().FCGIaccept()>= 0) { System.out.println("Content-type: text/html\n\n"); System.out.println(""); System.out.println( "FastCGI echo"); System.out.println(""); System.out.println("

FastCGI echo

"); System.out.println("

STDIN:

"); for ( int c = 0; c != -1; ) { try { c = System.in.read(); } catch(IOException e) { System.out.println( "
SYSTEM EXCEPTION"); Runtime rt = Runtime.getRuntime(); rt.exit(status); } if (c != -1) { System.out.print((char)c); } } System.out.println( "

Environmental Variables:

"); System.getProperties().list(System.out); System.out.println(""); System.out.println(""); } } }