Hi,
I'm trying to figure out how to use CGI::App with mod_perl 2. Usualy I
would wrap the application in a handler but mod_perl 2 handles
redirection in a different way than CGI.pm does (I could be wrong). On
exit from the application the handler returns either Apache::OK or
Apache::REDIRECT from the handler wrapper. I'm using libapreq 2 to
handle setting the headers through Apache::Request that's compatible
with MP2. What I need to do is return the appropriate constant after the
application made from CGI::App exits. Bear in mind with MP2 you no
longer need to $r->send_http_headers() anymore. The headers are
automatically sent.
use SomeWebApp;
use Apache::Const -compile => qw(OK REDIRECT);
sub handler {
my $r = shift;
my $webapp = SomeWebApp=>new( PARAMS => { REQUEST_OBJ => $r } );
$webapp->run();
# this needs to be either Apache::OK or Apache::REDIRECT
# depending on what the application does.
return Apache::OK;
}
Thanks,
Jamie
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.