The really cool thing is that you can retain the existing user URLs if you want, and simply specify a different view with a request parameter (which a user with a browser would never do) to get to the alternate Velocity template. Then, you're simply adding to the existing system instead of replacing it. Maverick would just have to be configured to dispatch to the alternate views.
For example a Velocity template like this: ---------Start of Velocity Template-------- $!firstName^$!lastName^$!email^$!phone ---------End of Velocity Template--------
(where the "$" indicates a Velocity variable, the "!" indicates not to output anything if the value is null, and the values are simply separated with "^" in a single line. Velocity docs are at <http://jakarta.apache.org/velocity/>)
...can be processed like this:
$url = "http://localhost/my/java/url?param=value&view=data"; // ...set the Maverick+Velocity URL to read, with params
$f = fopen ("$url", "r"); $data = fread($f, 65536); // Get the result of Java+Velocity output fclose($f);
// Now process the results in $data...
$results = explode("^", $data); // assuming variable-length data separated by "^"
$firstName = $results;
$lastName = $results;
$email = $results;
$phone = $results;
// etc... ?>
On May 25, 2004, at 1:21 PM, Lee McColl wrote:
I've recently teamed up with an applications developer to offer my web development skills and am currently picking apart his software. He currently has a nifty Java based server app which displays information through Maverick and Velocity. I believe there are lines in his Maverick Web.xml that read -
It is these lines that I am assuming allow his Java server app to send properties and results to his Velocity pages.
Anyway, what I want to do, if it is at all possible, is to change his system so that it sends the information to and through PHP pages. I'm happy to continue using Maverick if I can, but seeing as the system I built that bolts onto his software uses PHP, I would like to exchange all the .vm pages to also use the same PHP classes. Make sense? (I babble).
How can I do this? And if it's not possible with Maverick, what system can I use?
I originally thought Ambivalence was made for this, but having read the manual for it, it now seems more like a PHP templating system to seperate PHP code from the presentation, much like Maverick seperates Java from presentation.... But I've already built the PHP templating system using other means.
Please please help,
------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149&alloc_id66&op=click [INVALID FOOTER]