I found that I needed to use the Apache::Request object to print out the response or else it wouldn't work. This means replacing print with $r->print when appropriate. So I changed the _service function which is where the response gets printed out. The request object needs to get passed to the _service function.
About the request object: I just use the original code which creates the request object inside the service function, but you can also send it along via the PerlHandler.
Modified version of FLAP.pm
Apache Perl Handler
Next, I created a PerlHandler called Apache::FLAP.pm. It looks like:
package Apache::FLAP;
use strict;
use Flash::FLAP;
use Foo; # if registering this service
sub handler
{
my $r = shift;
my $gateway = Flash::FLAP->new();
# register services
$gateway->registerService("foo", new Foo());
# or, include base class path
$gateway->setBaseClassPath("./basicservices/");
$gateway->service();
}
1;
Apache httpd.conf file
Then I added some lines to my httpd.conf and I was all done.
The gateway url as configured below would be http://my_website.com/flap/
PerlModule Apache::FLAP
#Flash Remoting
<Location /flap> #location, directory, whatever you want.
SetHandler perl-script
PerlHandler Apache::FLAP
</Location>
Everything else works the same way as explained in the FLAP instructions.
Email me at rachel@nmcfarl.org or at work at rkr@lanl.gov
|