PHP combined with JAVA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hallo,

I write one Java class that gives my name back. I implemented the call of
this Java class in php Unit, but there are some problems, because I will to
make only one time the instance of Java class and put it into Session and
everytime when the page is reloaded to load the Java object from the
session.
By first time calling the php unit its work, but after reloading the unit
(in the example below, after clicking the button Send) I get everytime
java.lang.NullPointerException.

The example:
<?php
  session_start();
  echo "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">";
  if (!isset($_SESSION['P_User'])) {
    echo "Class not set<br>";
    $t = new Java("User");
    $_SESSION['P_User']= $t;
  } else {
    echo "Class set<br>";
  }
  $t1= $_SESSION['P_User'];
  echo $t1->getUserName();
  echo '<input type="submit" value="Send" name="B1">';
  echo "</form>"
?>

What I want to do, is to make only one time a instance of java class and to
use this object during the session (Internet browser of client) is opened
and not to create everytime the java instance by reloading or requesting
other php Unit.

Greetings,
Jerinic Stasa

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux