Finally, I found an excellent integration solution --- Quercus.
Quercus are integrated into resin and can be stored in Tomcat and other containers, But it is said that they are best combined with resin.
Install Resin step: http://www.caucho.com/resin-3.0/quercus/tutorial/hello/index.xtp
Quercus now supports php5.2. Follow the steps above to install PHPProgramDirectly deploy it in resin. php, JSP, and Java can be deployed in resin together without installing PhP5, which is very simple.
PHP calls Java class:
<? Php <br/> echo "Current Time:/R"; <br/> $ A = new Java ("Java. util. date "); <br/> echo $ A-> time; <br/>?>
PHP calls Java instance method:
<? Php <br/> echo "Current Time:/R"; <br/> $ A = new Java ("Java. util. date "); <br/> echo $ A-> gettime (); # callgettime () <br/> echo $ A-> settime (456 ); # callsettime (456) <br/> echo $ A-> time; # callgettime () <br/> $ A-> time = 456; # callsettime (456) <br/> echo $ A-> time; <br/>?> <Br/>
For more information about how to call Java object methods, import classes, type conversion, sharing Java connection pools with PHP, and setting PHP compilation to improve performance, see:
Http://quercus.caucho.com/quercus-3.1/doc/quercus.xtp
In addition, there is also a scheme called PHP and Java bridging scheme, which is more troublesome than Quercus:
Http://php-java-bridge.sourceforge.net/pjb/index.php