How can a Java program talk to a CGI program?
Web browsers display forms, read user input, encode that input into a standard format called a “query string”, and send that data to CGI programs that live on the web server. When you write an applet that talks to a CGI program, you have to do all this yourself. The first thing to know is that there are two ways a CGI program can accept data from a web browser, GET and POST. CGIs that use GET take their arguments from the URL. Programs that use POST read their arguments from standard input. The second thing to know is that when you submit data to a form through a web browser, the web browser encodes the data for you. In an applet, however, you need to encode the data yourself. The data is encoded like this: Each form entry is a name-value pair. Names and values are separated from each other by equals signs (=). Pairs are separated from each other by ampersands (&).