Menu

[r489]: / trunk / php-java-bridge / examples / java-server-faces / index.php  Maximize  Restore  History

Download this file

27 lines (21 with data), 630 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
function check($name) {
$len = strlen($name);
return strncasecmp(php_uname(), $name, $len) == 0;
}
function appendIncludeDir($dir) {
$append = check("windows")?";$dir":":$dir";
ini_set("include_path", ini_get("include_path").$append);
}
appendIncludeDir(".."); require_once("java/Java.inc");
// redirect to backend.
function redirect() {
$target=dirname($_SERVER['PHP_SELF']);
$backend=java_server_name();
if(!$backend) die("Servlet engine not running");
$array=split(":", $backend);
$port=$array[1];
header ("Location: http://$_SERVER[SERVER_NAME]:$port$target/helloWorld.jsf");
}
redirect();
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.