[Catalyst] How to manage error 404

Albert Vila avp at imente.com
Tue Jun 28 11:52:23 CEST 2005


I've I do this, how can I serve the default http://localhost:3000 ?

Chisel Wright wrote:

>On Tue, Jun 28, 2005 at 11:10:17AM +0200, Marcello wrote:
>  
>
>>A quick solutino I found to this problem is to have in my application 
>>package a default action like this:
>>
>>sub default : Private {
>>    my ( $self, $c ) = @_;
>>    $c->stash->{template} = 'invalid_request';
>>    $c->req->action(undef);
>>}
>>    
>>
>
>I've not tried this out, but what about:
>
> sub default : Private {
>    my ( $self, $c ) = @_;
>	# use the default 404 page for the server
>    $c->res->status(404);
>	# make sure we have no action
>    $c->req->action(undef);
> }
>
>I don't know if undefining the action is still required, but I don't see
>any harm in leaving it there.
>
>Chisel
>  
>

-- 
Albert Vila
Director de proyectos I+D
http://www.imente.com
902 933 242
[iMente La información con más beneficios]




More information about the Catalyst mailing list