[Catalyst] handler sub required
Tomas Doran
bobtfish at bobtfish.net
Sat Jul 23 09:38:23 GMT 2011
On 23 Jul 2011, at 02:52, Alain Wan wrote:
> The code is as follows:
>
> app.pm:
>
> package app;
>
> use Apache2::RequestRec ();
> use Apache2::RequestIO ();
>
> use Apache2::Const -compile => qw(OK);
>
Why are you importing any of this stuff?
You should let Catalyst take care of loading the engine etc itself.
> use Moose;
> use namespace::autoclean;
>
> BEGIN { extends 'Catalyst::Controller::REST' }
>
> sub hello :Local :ActionClass('REST') {
> print "handler entered\n";
> }
>
Don't put actions in the root application class! It should work
currently, but it's not been generated by the helper for > 3 years,
and it'll stop working in an upcoming major release!
Please start with the template generated by catalyst.pl, which will
give you an app::Controller::Root.
Although I'd suggest 'app' isn't the best namespace for your
application :)
Cheers
t0m
More information about the Catalyst
mailing list