|
From: <php...@li...> - 2008-01-21 08:15:53
|
hello,erverybody
I am sorry, in my former letter, I did not describe my problem clearly! I will give more information.
My website is written in php script and I have to call some java fuctions(these functions is used to implement a complicated algorithms), so i have to user the php-java-bridge to connect php and java,but I find it is very difficult to debug my programme. When I forget to include some libs, the php page just display
nothing, this situation slow my speed of developing very much. I hope someone is so kindly to tell me some way to debug my programme.
I am a newer to begin programming with php_java_bridge(begin from last Monday). In the coding process, I encountered two problems:
1. I can't use new a object with the parameter .
for example:
it is ok: $obj = new Java("parser.ParseNode);
it is not ok $pobj = new Java("parser.ParseNode","/home/lvhl/apache/test/parseweb/bin/elong.htm","gb2312");
//class parser.ParseNode has a construct function : ParseNode(String str ,String encoding)
2. I can't call a non-static function fo parser.ParseNode
also use the same example:
it is ok :
$obj = new Java("parser.ParseNode);
echo $pobj->printHello(); //printHello is a static function of parser.ParseNode
it is not ok and output is nothing: echo $pobj->printTest(); //printTest is not a static function
of parser.ParseNode
define of the functions:
public static String printHello()
{
return "Hello World,dajiahao!";
}
public String printTest()
{
return "Hello,test!";
}
Is there anybody who is so kind to tell me why ? Thank you very much!
My develop environment:
OS: Fedora 8
web server :Apache/2.2.6 (Unix)
PHP: php5.2.4
java : javac 1.6.0_03 java version "1.7.0"
php-java-bridge: php-java-bridge-5.0.0
browser:firefox 2.0.0.11 and IE7
and the php-java-bridge as a moudle of apache, didn't use tomcat
2008-01-21
lvhl.tech
|