Hi,
I'm trying to handle an exception using an internal_redirect. I
can get it to work by redirecting to a static page, but when I try to
redirect to a modperl handler, I'm run into problems.
Here are the two versions of code (BTW, the handler works fine when I
access it directly via the browser).
## ver. 1
print STDERR "$@";
require Apache;
my $r = Apache->request;
$r->internal_redirect("/DBConnectError.cgi");
## ver. 2
print STDERR "$@";
require Apache;
my $r = Apache->request;
$r->internal_redirect("/errordocs/503.html");
When I run the modperl handler, the browser prompts me and asks if I
want to save the output of the cgi script that raised the error, but
it never displays the content from the handler. The static file
version works great and the browser displays it's content.
Here's the code for DBConnectError.pm
--------------------------------------
package Tec::Api::DBConnectError;
use strict qw(vars);
use Apache;
use Apache::Constants;
sub handler
{
my $r = shift;
$r->content_type('text/html');
$r->send_http_header;
$r->print (<<THIS);
<HTML>
<HEAD>
<TITLE>DB Problems</TITLE>
</HEAD>
<BODY>
<H1>I can't connect</H1>
oh, well... Try again later!
<p>
I can't believe this might actually work...
</BODY>
</HTML>
THIS
return OK;
}
1;
Sorry for the long email... any help will be appreciated.
-Jim
PGP signature