Reply
Old April 11th, 2006 Top | #1
 
wessleym's Avatar
OSNN Addict
Joined: March 2003
Posts: 99
Reputation: 0
Power: 113

Default Passing data from CGI to Java and back

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?
wessleym is offline   Reply With Quote
Old April 11th, 2006 Top | #2

OSNN Folding Team  
Geffy's Avatar
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,805
Reputation: 1490
Power: 217

Default Re: Passing data from CGI to Java and back

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

Code:
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


blogtumbloglastfmflickr#rubyonrails@twitter
"I could be replaced with a very small shell script"
Geffy is offline   Reply With Quote
Old April 11th, 2006 Top | #3
 
wessleym's Avatar
OSNN Addict
Joined: March 2003
Posts: 99
Reputation: 0
Power: 113

Default Re: Passing data from CGI to Java and back

Geffy, thanks so much! I thought about doing that but never thought it would work. It seemed too simple. Thanks again!
wessleym is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing the exam! itsmelisa Funny Farm 3 March 10th, 2007 12:37am
PASSING OF A GENERATION: Something to think about ... El Pescador Green Room 7 April 27th, 2005 4:32pm
microsoft java coming back? perris Green Room 2 April 3rd, 2004 11:51pm
HTML - Form data kept with "Back" button Swi Web Design & Coding 3 March 26th, 2004 4:15am
Passing URL value Nismo83 Web Design & Coding 4 October 29th, 2002 9:39am