I was forced to move from mod_perl to mod_perl2 because of Ubuntu. I had
originally created an Apache-Cocoon/Apache-AxKit-type infrastructure for the
site. Pages just generated an XML tree and apply 1 or more XSLT stylesheets.
There were more issues than I could posibly count (mostly my fault, I'm
sure, though my code was able to core dump mod_perl2!) with how I was
manipulating mod_perl and Apache which arose on the transition.

Anyhow, unfortunately for me, I'm using Error.pm exceptions all over the
place. One way I use it is for redirection: throw E:Redirect url =>
http://foo. And I'm wrapping the RegistryCooker handler (Registry handler in
mod_perl 1). I have a catch statement in my handler, though I guess I never
realized that my redirect trick was working by accident in mod_perl 1, and
now it doesn't work at all in mod_perl 2. (By accident because the
default_handler executes the page in an eval {})

The redirect exception object construction sets the Location header and
status code. With mod_perl 1 I guess this was enough to get the job done,
but with mod_perl 2 this just doesn't fly. (I Suppose now mod_perl 2 munges
the status code).

I guess what I'm asking is what's the quickest way to get the actual
behavior that I want; specifically, being able to throw exceptions into my
andler. Re-writing the default handler (which loads and caches the pages)
seems like the most work, so I'm looking for an easier answer, if any ;) For
that effort it seems I might was well grab Cocoon 3 and switch to Java.

- Bill

Reply via email to