GWT-Ext & PHP , Glassfish & Apache

Berikut cara macam mana nak guna GWT-Ext dalam Galssfish dan data dalam Apache-PHP.

1. Install Quercus. Ni carik post aku sebelum ni.
2. Create gateway script dalam glassfish (php-Quercus). Nama fail sebaiknya sama dengan nama fail dalam apache (php).

Fail scriptnya adalah seperti di bawah. Support untuk GET, POST & SESSION.


// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://localhost/adapt-gwt/index.php");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);

curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);

// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>

0 comments:

 
Copyright © peyotest