Hi,
I have used "is_null(java_values($javaValue))".
Here are the two functions from my code. The first one
is the one that does not works as it should work.
function getRepositoryFactory(){
global $CFG;
require_once($CFG->dirroot.'/depths/setup/depths_config.php');
$javabridge=get_string('javabridge','depths');
require_once($javabridge);
$myLib=get_string('moodle_jar_file','depths');
java_require($CFG->wwwroot.'/'.$myLib);
$session=java_session();
$rep=$session->get($rep);
if(is_null(java_values($rep))){
try{
$rep=new Java("depths.moodle.RepositoryFactory");
$session->put("rep",$rep);
if(is_null(java_values($rep))){
throw new Exception("Could not create
repository!");
}
}catch(Exception $e){); }
}
return $rep;
}
function getProjectFactory($sesame){
global $CFG;
require_once($CFG->dirroot.'/depths/setup/depths_config.php');
$javabridge=get_string('javabridge','depths');
require_once($javabridge);
$myLib=get_string('moodle_jar_file','depths');
java_require($CFG->wwwroot.'/'.$myLib);
$session=java_session();
$projectFact=$session->get("projectFact");
if(is_null(java_values($projectFact))){
try{
$projectFact=new
Java("depths.moodle.ProjectsFactory",$sesame);
$session->put("projectFact",$projectFact);
} catch (JavaException $ex){
$exStr=java_cast($ex, "string");
echo "Exception occured; mixed trace: $exStr\n";
$trace=new
java("java.io.ByteArrayOutputStream");
$ex->printStackTrace(new
java("java.io.PrintStream", $trace));
print "java stack trace: $trace\n";
}
}
return $projectFact;
}
= = = Original message = = =
Hi,
> items on each page. This page creates 3 java session
variables on
exactly the same way, first it
> checks if variable already exists and if not it
creates it and put in
session.
I think it depends on how you do the check.
is_null(java_values($javaValue)) or
java_is_null($javaValue) or if
(!(string)$javaValue)
will work.
if (!$javaValue)
will not.
E-Mails jetzt auf Ihrem Handy.
www.yahoo.de/go
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM)
Conference
Don't miss this year's exciting event. There's still
time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
___________________________________________________________
Sent by ePrompter, the premier email notification
software.
Free download at http://www.ePrompter.com.
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
|