• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applet CGI Communication

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sri Latha
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
reply
    Bookmark Topic Watch Topic
  • New Topic