How can convert Java Servlet into PHP?

Drop Java Inc. into a directory.

<?php
define("JAVA_HOSTS", "localhost:8080");
define("JAVA_SERVLET", "/MyWebApp/Hello");
require_once("Java.inc");

echo java_context()->getServlet()->hello();
?>

Use this code and then run the PHP script and that should work to display your results. What is the purpose of even doing this though? You could use straight PHP and the code would be cleaner.
 
Drop Java Inc. into a directory.

<?php
define("JAVA_HOSTS", "localhost:8080");
define("JAVA_SERVLET", "/MyWebApp/Hello");
require_once("Java.inc");

echo java_context()->getServlet()->hello();
?>

Use this code and then run the PHP script and that should work to display your results. What is the purpose of even doing this though? You could use straight PHP and the code would be cleaner.


I agree with you..
 
Back
Top