This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Netscape+applet+cgi=???
Posted by Vitaliy on July 09, 1999 at 4:42 AM
I need a help. This is my code for calling cgi from applet. try{ URL u=new URL(cgi_place); URLConnection connection=u.openConnection(); connection.setDoOutput(true); PrintWriter out=new PrintWriter(connection.getOutputStream()); out.println(URLEncoder.encode(out_string)); out.close(); BufferedReader in=new BufferedReader(new InputStreamReader(connection.getInputStream())); while (in.ready()) System.out.println(in.readLine()); in.close(); System.out.println("done"); }catch(Exception ex){System.out.println(ex.toString());} CGI must write input information into file. It's work correct while I'm use appletviewer(java 1.2) but if I use this code under Nescape 4.04 it write "done" and thats all. Why??? May be CGI must return something exclude "Content-type: text/plain\n\n" or may be I must setup some fields in URLConnection? I don't know. Help plz!
Replies:
|