Thanks a lot! I am using a different port number other than what the
webserver is using (80). Is this the problem? I do it this way because I
use a server program (instead of webserver) to communicate with the
applet. I thought URLConnection is much easier to parse the message than
the raw socket, so....
Thanks!
Xizhen
Gary Johnson wrote:
>
> Xizhen,
> I have several applets that open a URLConnection back to the server from
> which it came. The basics I use are as follows.
>
> int host_port = 80;
> BufferedReader data = null;
> String line = "";
> String cgiOut[];
> String host_addr = "111.222.333.444";
> String cgiq = "cgi_pgm" + "?PARAM1=" + URLEncoder.encode(p1);
>
> URL u = new URL("http",host_addr,host_port,cgiq);
> URLConnection ucon = u.openConnection();
> ucon.connect();
>
> data = new BufferedReader(new
> InputStreamReader(ucon.getInputStream()));
>
> while ((line = data.readLine()) != null) {
> cgiOut[i++] = line;
> }
>
> Hope this helps...
>
> Gary Johnson
> Exponent Failure Analysis
>
> -----Original Message-----
> From: Xizhen Wang [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 28, 1999 7:58 PM
> To: [EMAIL PROTECTED]
> Subject: build URLConnection between Applet and server
>
> Hi! Is it allowed by the security manager to build a URLConnection
> between Applet and server? (without signed applet)
>
> I tried, but it failed. I know we can build a socket connection, but how
> about URLConnection?
>
> Thanks!
>
> Unsubscription, archives, FAQ - http://www.xcf.berkeley.edu/lists.html
>
> Unsubscription, archives, FAQ - http://www.xcf.berkeley.edu/lists.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html