aspose file tools*
The moose likes Applets and the fly likes Applet CGI Communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet CGI Communication" Watch "Applet CGI Communication" New topic
Author

Applet CGI Communication

Sri Latha
Greenhorn

Joined: Jan 22, 2008
Posts: 10
Hello every one,

I want to connect to a cgi file from Applet class.Can anybody tell me how to do this?


Thanks and Regards,
Latha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41852
    
  63
Welcome to JavaRanch.

By "a .cgi file" I assume you mean a server-side program accessible through a URL? If so, it could be as simple

and then reading the response from the stream. It gets a bit more complicated if the CGI program expects a POST instead of a GET.
[ January 22, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Sri Latha
Greenhorn

Joined: Jan 22, 2008
Posts: 10
Hello.

Thanks a lot.
I have done with calling a CGI file from an applet.
And now i have called one .class file of java from that CGI file,Where that java file has an applet that should be launched when i call a CGI file from an applet.

Instead of launching an applet ,that java file sending the whole respose to the Sun Java Console

Can anybody tell me how to do this?

Thanks and Regards,
Latha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41852
    
  63
On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

And now i have called one .class file of java from that CGI file, Where that java file has an applet that should be launched when i call a CGI file from an applet.

I don't understand this. What does it mean to "call a .class file from the CGI file"? The CGI program runs on the server - are you starting a server-side process from it? Furthermore, an applet runs on the client - nothing the server does can start it. Please tell us in more detail what you're trying to do.
Sri Latha
Greenhorn

Joined: Jan 22, 2008
Posts: 10
hello,

/usr/bin/java cgisvr .Here cgisvr(Java) is a .class file.I am passing some parameters to .cgi file. where this file called from the applet through URL.

Then in that .cgi file ,i am calling one java file(/usr/bin/java cgisvr) from where i have to launch one applet with some parameters to be displayed.

Thanks and Regards,
Latha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41852
    
  63
Then in that .cgi file ,i am calling one java file(/usr/bin/java cgisvr) from where i have to launch one applet with some parameters to be displayed.

As I said, you can't launch an applet from a server-side CGI program. Applets are launched from within a web page displayed in a browser.

You could read whatever parameters the CGI outputs, and then pass those to another JSP page, which in turn uses them to write an applet tag. This other JSP page could either replace the current page, or be opened in a new browser window. Does that sound OK?

Please change you display name as I asked you to above. This is not optional, and accounts with an invalid display name are generally closed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet CGI Communication