Passing data from CGI to Java and back


OSNN Addict
5 Mar 2003
For a class, I have to pass data from a CGI (written in Perl) script to a Java program. This is easy enough, but I need to make the Java program return the data it finds to the CGI script. Can someone tell me how to do that?
depends on how you are passing the data to the java program. If you are running it as a command line application then you can just print the output from the java program to the standard output device and use backticks (`) to call the java program

perlvar = `java MyJavaApp param1 param2`

thats how I would go about it, its not the most safe and secure way mind, so make sure you do a damn good job of cleaning any parameters you are passing to the java program so that you dont get random code executed alongside your call to the java program
Geffy, thanks so much! I thought about doing that but never thought it would work. It seemed too simple. Thanks again!

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Latest member