[Catalyst] Serving a custom 404 page with Catalyst::Plugin::Static::Simple

Will Hawes wdhawes at gmail.com
Wed Oct 10 16:13:45 GMT 2007


With Catalyst::Plugin::Static::Simple loaded, when I request a path like
'/static/non-existent-file', the plugin does stuff like $c->res->status(404)
for me by default. However, as I already have the following in
MyApp::Controller::Root:

sub default : Private {
  my( $self, $c ) =3D @_;
  $c->res->status( 404 );
  $c->res->body( ...  );
}

I'd like to use my existing default action to display something a bit more
user friendly when the requested static file is missing. In this case I'm
using the test server so bypassing Catalyst::Plugin::Static::Simple
completely is not an option.

What's the correct way to implement the above?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071010/4f48a=
53b/attachment.htm


More information about the Catalyst mailing list