PDA

View Full Version : passing parameters between two servers


d~l
09-12-2004, 12:44 PM
Basic question.

I have navigation links in another Apache server (external to Laszlo Tomcat server).

On-click of each link on remote client page I need to pass a number of variables from that HTML page into the Laszlo running webapp.

e.g. one set of parameters might be the path to a node in an XML database to be retrieved in Laszlo webapp and content displayed.

e.g. 1.4.6.4.6.7.4 might be a path to a record

how best to pass these global variables to Laszlo?

.....

To help visualise this, consider two iframes displayed in browser in a client PC.

left iframe (navigation links) points to web app running on Apache / PHP server ..

right iframe points to Tomcat / Laszlo web app.

I need the links in left iframe (on-click) to pass parameters between the two servers, and target and change the content of right iframe.

I hope this setup is clear. Thanks.

d~l
09-15-2004, 03:07 PM
I've think I have solved my problem of communicating between Laszlo app and Apache/PHP server ..

I create a PHP script running in Apache server ..

open this PHP page from an onclick link in Laszlo app .. (i.e. Laszlo app is now the "client" to the Apache server)

this PHP script generates an XML dataset in Apache server

Laszlo app then imports the PHP generated dataset (including any PHP variables to be passed from Apache hosted apps).

Example: here is a simple script .. dataset.php .. which is a phonebook record parsed as XML by PHP

<?php
print ("<phonebook>\n");
print ("<contact>\n");
print ("\t<firstName>Norton W.</firstName>\n");
print ("\t<lastName>Carrprint </lastName>\n");
print ("\t<email>Tchr4evr70@aol.com </email>\n");
print ("\t<website>\n");
print ("\t</website>\n");
print ("\t<year>1948</year>\n");
print ("</contact>\n");
print ("</phonebook>\n");
?>


I run http://localhost:88/dataset.php (from Tomcat on port 8080) ..

which is imported into LZX app as ..

<phonebook>
<contact>
<firstName>Norton W.</firstName>
<lastName>Carrprint </lastName>
<email>Tchr4evr70@aol.com </email>
<website>
</website>
<year>1948</year>
</contact>
</phonebook>


This allows PHP variables to be passed to LZX app.