I need to develop a web application using PHP and the Apache web server. The application should call an external Java-based application which is stored in the host computer and pass the user's input value to this application which will analyse it and do something. I have been reading articles about PHP/Java and it seems that the best solution is to integrate a PHP into a Java servlet environment such as PHP/JavaBridge. As I am not an expert on web development and pretty ignorant on PHP, can someone tell me if this is the best solution and if not, what other possible approaches should I use it? Thanks in advance!
2
-
What kind of application are you trying to call? Is it a command line application written in Java, a web-based Java application, an applet? These types of applications require different methods to call them.jan.vdbergh– jan.vdbergh2011-02-04 12:50:43 +00:00Commented Feb 4, 2011 at 12:50
-
It's a standard stand-alone application, not web-based...Anto– Anto2011-02-04 13:32:23 +00:00Commented Feb 4, 2011 at 13:32
Add a comment
|
3 Answers
The application should call an external Java-based application which is stored in the host computer and pass the user's input value to this application which will analyse it and do something.
WebServices are perfectly suited here.
Also See
Comments
You could do something like this:
$parameter1='your';
$parameter2='parameters';
$output = shell_exec("java whatever.jar $parameter1 $parameter2");
echo $output;
* Update *
I do agree with Jigar Joshi, though. I think a web service would be the best option here.
1 Comment
extraneon
This is actually the answer to the question (thus the +1 vote). As starting the java runtime is quite expensive (for a web request) and results in a high latency, I do agree with the Update that Web services are a better answer to the problem.