in reply to JavaCGIBridge
I second fever's suggestion, especially given the simplicity of getting data via HTTP in Java. The code below is just a toy example of a program that takes an URL as a command line argument and prints the corresponding web page to standard out. This is the most simple minded approach, I'm sure one can do it much better, it's just a piece of code I'd around.
Just my 2 cents, -gjb-import java.net.*; import java.io.*; public class HTTPclient { public static void main(String args[]) throws Exception { URL url = new URL(args[0]); URLConnection conn = url.openConnection(); char c; InputStream input = conn.getInputStream(); while((c = (char) input.read()) != -1) { System.out.print((char) c); } input.close(); } }
|
|---|