[Catalyst] How to manage error 404
jonathan zou
jonzou at gmail.com
Thu Jun 30 18:48:32 CEST 2005
sorry,no luck,I followed the code and when server started
.=-------------------------------------+--------------------------------------=.
| Public | Private |
|=-------------------------------------+--------------------------------------=|
| // | /my_root |
'=-------------------------------------+--------------------------------------='
when access root
"GET" request for "" from *****
so still call default
change absolute path to '',action will not load
any idea? thanks
On 6/29/05, samwyse <samwyse at gmail.com> wrote:
> On 6/28/05, Albert Vila <avp at imente.com> wrote:
> > I've I do this, how can I serve the default http://localhost:3000 ?
>
> I create Path and RegEx subroutines that will catch everything that's
> supposed to work, and only use 'default' to handle the 404's:
>
> sub my_root : Path('/') {
> # this should handle http://localhost:3000/
> }
>
> sub default : Private {
> my ( $self, $c ) = @_;
> $c->res->status(404);
> $c->res->content_type('text/plain');
> my ( $method, $protocol, $uri, $referer ) = (
> $c->request->method,
> $c->request->protocol,
> $c->request->uri,
> $c->request->referer,
> );
> $c->res->output(
> "Your $method request for $uri via $protocol failed.\n\n" .
> ( $referer ?
> "If possible, please update $referer" :
> "Please try again." )
> );
> }
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
More information about the Catalyst
mailing list