FAQ
Catalyst isn't dispatching how I expected. A 'Login' controller has

sub get_sess :Chained('/') :PathPart('login/id') :CaptureArgs(1) {..}
sub audit_log :Chained('get_sess') :PathPart('audit_log') :Args(0) {..}

On startup, Catalyst reports the actions as expected,
/login/id/*/audit_log | /login/get_sess (1)
=> /login/audit_log
But on requesting 'http://localhost:3000/login/id/124/audit_log' I see

[debug] Path is "/"
[debug] Arguments are "login/id/124/audit_log"

and Catalyst calls the Root's default action. Why might it not have
matched the Login actions?

I'm using Catalyst 5.80033. Below are all the non-private actions
reported on startup.

[debug] Loaded Path actions:
.-------------------------------------+--------------------------------------.
Path | Private |
+-------------------------------------+--------------------------------------+
/ | /index |
/... | /default |
/books/ | /books/index |
/login/ | /login/index |
/login/cheat1/... | /login/cheat1 |
/login/cheat2/... | /login/cheat2 |
/login/doit/ | /login/doit |
/login/list/... | /login/list |
/logout/ | /logout/index |
'-------------------------------------+--------------------------------------'

[debug] Loaded Chained actions:
.-------------------------------------+--------------------------------------.
Path Spec | Private |
+-------------------------------------+--------------------------------------+
/books/create | /books/bmodel (0) |
=> /books/create |
/books/id/*/edit | /books/bmodel (0) |
-> /books/get_book_from_db (1) |
=> /books/edit |
/books/list | /books/bmodel (0) |
=> /books/list |
/books/list_recent/* | /books/bmodel (0) |
=> /books/list_recent |
/books/list_recent_tcp/* | /books/bmodel (0) |
=> /books/list_recent_tcp |
/books/id/*/show | /books/bmodel (0) |
-> /books/get_book_from_db (1) |
=> /books/show |
/error_noperms | /error_noperms |
/login/id/*/audit_log | /login/get_sess (1) |
=> /login/audit_log |
'-------------------------------------+--------------------------------------'

--
Nick

Search Discussions

  • Tomas Doran at Sep 6, 2011 at 1:47 pm

    On 6 Sep 2011, at 14:34, Nick wrote:

    Catalyst isn't dispatching how I expected. A 'Login' controller has
    This is due to you mixing path and chained actions. The path actions
    take higher priority if they're able to match at all..
    [debug] Loaded Path actions:
    .-------------------------------------
    +--------------------------------------.
    Path |
    Private |
    +-------------------------------------
    +--------------------------------------+
    / | /
    index |
    /... | /
    default |
    Try changing this to sub default : Chained('/') Args()

    and see if that helps?

    Cheers
    t0m
  • Nick at Sep 6, 2011 at 2:12 pm

    On 2011-09-06 14:47, Tomas Doran wrote:
    This is due to you mixing path and chained actions. The path actions
    take higher priority if they're able to match at all..
    [debug] Loaded Path actions:
    .-------------------------------------+--------------------------------------.
    Path | Private
    +-------------------------------------+--------------------------------------+
    / | /index

    /... | /default
    Try changing this to sub default : Chained('/') Args()
    Like this -

    sub default :Chained('/') :Args() {..}

    - in the Root controller? Sadly, it did not help, the default action
    still runs.

    I put a debug message into Catalyst::Dispatcher and it reports

    [debug] "GET" request for "login/124/audit_log" from "127.0.0.1"
    [debug] Catalyst::DispatchType::Index matches 'login/124/audit_log'? 0
    [debug] Catalyst::DispatchType::Path matches 'login/124/audit_log'? 0
    [debug] Catalyst::DispatchType::Regex matches 'login/124/audit_log'? 0
    [debug] Catalyst::DispatchType::Chained matches 'login/124/audit_log'? 0
    [debug] Catalyst::DispatchType::Default matches 'login/124/audit_log'? 0
    [debug] Catalyst::DispatchType::Index matches 'login/124'? 0
    [debug] Catalyst::DispatchType::Path matches 'login/124'? 0
    [debug] Catalyst::DispatchType::Regex matches 'login/124'? 0
    [debug] Catalyst::DispatchType::Chained matches 'login/124'? 0
    [debug] Catalyst::DispatchType::Default matches 'login/124'? 0
    [debug] Catalyst::DispatchType::Index matches 'login'? 0
    [debug] Catalyst::DispatchType::Path matches 'login'? 0
    [debug] Catalyst::DispatchType::Regex matches 'login'? 0
    [debug] Catalyst::DispatchType::Chained matches 'login'? 0
    [debug] Catalyst::DispatchType::Default matches 'login'? 0
    [debug] Catalyst::DispatchType::Index matches ''? 0
    [debug] Catalyst::DispatchType::Path matches ''? 0
    [debug] Catalyst::DispatchType::Regex matches ''? 0
    [debug] Catalyst::DispatchType::Chained matches ''? 0
    [debug] Catalyst::DispatchType::Default matches ''? 1
    [debug] Arguments are "login/124/audit_log"

    (The 0 or 1 at the end is whether the dispatcher reported a match.)

    If I understand correctly, the full path is being considered fairly
    early in the matching process, as a chained action, and is rejected.
    But I do not see why.

    --
    Nick
  • Tomas Doran at Sep 6, 2011 at 2:17 pm

    On 6 Sep 2011, at 15:12, Nick wrote:
    On 2011-09-06 14:47, Tomas Doran wrote:
    This is due to you mixing path and chained actions. The path actions
    take higher priority if they're able to match at all..
    [debug] Loaded Path actions:
    .-------------------------------------
    +--------------------------------------.
    Path | Private
    +-------------------------------------
    +--------------------------------------+
    / | /index

    /... | /default
    Try changing this to sub default : Chained('/') Args()
    Like this -

    sub default :Chained('/') :Args() {..}

    - in the Root controller? Sadly, it did not help, the default action
    still runs.

    I put a debug message into Catalyst::Dispatcher and it reports
    I have no idea what this actually means, sorry
    But I do not see why.
    Nor do I, probably as you've only provided us snippets.

    Fancy sharing the full debug startup for the app (with my suggested
    change) and the request in question?

    Cheers
    t0m
  • Nick at Sep 6, 2011 at 2:30 pm

    On 2011-09-06 15:17, Tomas Doran wrote:
    Fancy sharing the full debug startup for the app (with my suggested
    change) and the request in question?
    Sure, thanks for looking at it. The startup messages and response to
    the request http://localhost:3000/login/124/audit_log follow below.
    The source code is at https://gitorious.org/catex/catex/trees/master


    $ CATALYST_DEBUG=1 script/myapp_server.pl
    [debug] Debug messages enabled
    [debug] Statistics enabled
    [debug] Loaded plugins:
    .----------------------------------------------------------------------------.
    Catalyst::Plugin::Authentication 0.10017 |
    Catalyst::Plugin::Authorization::Roles 0.09 |
    Catalyst::Plugin::ConfigLoader 0.30 |
    Catalyst::Plugin::Session 0.31 |
    Catalyst::Plugin::Session::State::Cookie 0.17 |
    Catalyst::Plugin::Session::Store::DBI 0.16 |
    Catalyst::Plugin::StackTrace 0.11 |
    '----------------------------------------------------------------------------'

    [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [debug] Loaded engine "Catalyst::Engine::HTTP"
    [debug] Found home "/home/nick/catut/MyApp"
    [debug] Setting up auth realm default
    [debug] Loaded Config "/home/nick/catut/MyApp/myapp.conf"
    [debug] Loaded components:
    .-----------------------------------------------------------------+----------.
    Class | Type |
    +-----------------------------------------------------------------+----------+
    MyApp::Controller::Books | instance |
    MyApp::Controller::Login | instance |
    MyApp::Controller::Logout | instance |
    MyApp::Controller::Root | instance |
    MyApp::Model::DB | instance |
    MyApp::Model::DB::AppAction | class |
    MyApp::Model::DB::AppRole | class |
    MyApp::Model::DB::AppSession | class |
    MyApp::Model::DB::AppUser | class |
    MyApp::Model::DB::AppUserRole | class |
    MyApp::Model::DB::Author | class |
    MyApp::Model::DB::Book | class |
    MyApp::Model::DB::BookAuthor | class |
    MyApp::View::HTML | instance |
    '-----------------------------------------------------------------+----------'

    [debug] Loaded Private actions:
    .----------------------+--------------------------------------+--------------.
    Private | Class | Method |
    +----------------------+--------------------------------------+--------------+
    /error_noperms | MyApp::Controller::Root | error_noper- |
    ms |
    /default | MyApp::Controller::Root | default |
    /end | MyApp::Controller::Root | end |
    /index | MyApp::Controller::Root | index |
    /auto | MyApp::Controller::Root | auto |
    /logout/index | MyApp::Controller::Logout | index |
    /login/cheat2 | MyApp::Controller::Login | cheat2 |
    /login/doit | MyApp::Controller::Login | doit |
    /login/cheat1 | MyApp::Controller::Login | cheat1 |
    /login/index | MyApp::Controller::Login | index |
    /login/cheat | MyApp::Controller::Login | cheat |
    /login/get_sess | MyApp::Controller::Login | get_sess |
    /login/audit_log | MyApp::Controller::Login | audit_log |
    /login/list | MyApp::Controller::Login | list |
    /books/create | MyApp::Controller::Books | create |
    /books/show | MyApp::Controller::Books | show |
    /books/get_book_fro- | MyApp::Controller::Books | get_book_fr- |
    m_db | | om_db |
    /books/edit | MyApp::Controller::Books | edit |
    /books/bmodel | MyApp::Controller::Books | bmodel |
    /books/index | MyApp::Controller::Books | index |
    /books/list_recent | MyApp::Controller::Books | list_recent |
    /books/list_recent_- | MyApp::Controller::Books | list_recent- |
    tcp | | _tcp |
    /books/list | MyApp::Controller::Books | list |
    '----------------------+--------------------------------------+--------------'

    [debug] Loaded Path actions:
    .-------------------------------------+--------------------------------------.
    Path | Private |
    +-------------------------------------+--------------------------------------+
    / | /index |
    /books/ | /books/index |
    /login/ | /login/index |
    /login/cheat1/... | /login/cheat1 |
    /login/cheat2/... | /login/cheat2 |
    /login/doit/ | /login/doit |
    /login/list/... | /login/list |
    /logout/ | /logout/index |
    '-------------------------------------+--------------------------------------'

    [debug] Loaded Chained actions:
    .-------------------------------------+--------------------------------------.
    Path Spec | Private |
    +-------------------------------------+--------------------------------------+
    /books/create | /books/bmodel (0) |
    => /books/create |
    /books/id/*/edit | /books/bmodel (0) |
    -> /books/get_book_from_db (1) |
    => /books/edit |
    /books/list | /books/bmodel (0) |
    => /books/list |
    /books/list_recent/* | /books/bmodel (0) |
    => /books/list_recent |
    /books/list_recent_tcp/* | /books/bmodel (0) |
    => /books/list_recent_tcp |
    /books/id/*/show | /books/bmodel (0) |
    -> /books/get_book_from_db (1) |
    => /books/show |
    /default/... | /default |
    /error_noperms | /error_noperms |
    /login/id/*/audit_log | /login/get_sess (1) |
    => /login/audit_log |
    '-------------------------------------+--------------------------------------'

    [info] Cyberpaper Publishing powered by Catalyst 5.80033
    You can connect to your server at http://nickpad:3000
    [info] *** Request 1 (0.167/s) [11297] [Tue Sep 6 15:24:04 2011] ***
    [debug] "GET" request for "login/124/audit_log" from "127.0.0.1"
    [debug] Arguments are "login/124/audit_log"
    [debug] Found sessionid "3ad0d3ef9c070c268cbcebd9cc7f1b0820c91dec" in cookie
    [debug] Restored session "3ad0d3ef9c070c268cbcebd9cc7f1b0820c91dec"
    [debug] Response Code: 404; Content-Type: text/html; charset=utf-8; Content-Length: 34
    [info] Request took 0.057209s (17.480/s)
    .------------------------------------------------------------+-----------.
    Action | Time |
    +------------------------------------------------------------+-----------+
    /auto | 0.000904s |
    /default | 0.000276s |
    /end | 0.035989s |
    '------------------------------------------------------------+-----------'

    --
    Nick
  • Tomas Doran at Sep 6, 2011 at 2:37 pm

    On 6 Sep 2011, at 15:30, Nick wrote:
    /default/... | /
    default |
    This is your bug, probably as you copied what I said without stopping
    to think about it (and I forgot a bit!) :)

    sub default : Chained('/') PathPart('') Args() {

    Cheers
    t0m
  • Nick at Sep 6, 2011 at 2:49 pm

    On 2011-09-06 15:37, Tomas Doran wrote:
    On 6 Sep 2011, at 15:30, Nick wrote:

    /default/... | /default
    This is your bug, probably as you copied what I said without
    stopping to think about it (and I forgot a bit!) :)

    sub default : Chained('/') PathPart('') Args() {
    I made that change, but the default action still runs.
    --
    Nick
  • Tomas Doran at Sep 6, 2011 at 4:33 pm

    On 6 Sep 2011, at 15:49, Nick wrote:
    On 2011-09-06 15:37, Tomas Doran wrote:
    On 6 Sep 2011, at 15:30, Nick wrote:

    /default/... | /default
    This is your bug, probably as you copied what I said without
    stopping to think about it (and I forgot a bit!) :)

    sub default : Chained('/') PathPart('') Args() {
    I made that change, but the default action still runs.
    New debug please?
  • Nick at Sep 6, 2011 at 4:52 pm

    On 2011-09-06 17:33, Tomas Doran wrote:
    sub default : Chained('/') PathPart('') Args() {
    I made that change, but the default action still runs.
    New debug please?
    Sure,

    $ CATALYST_DEBUG=1 script/myapp_server.pl
    [debug] Debug messages enabled
    [debug] Statistics enabled
    [debug] Loaded plugins:
    .----------------------------------------------------------------------------.
    Catalyst::Plugin::Authentication 0.10017 |
    Catalyst::Plugin::Authorization::Roles 0.09 |
    Catalyst::Plugin::ConfigLoader 0.30 |
    Catalyst::Plugin::Session 0.31 |
    Catalyst::Plugin::Session::State::Cookie 0.17 |
    Catalyst::Plugin::Session::Store::DBI 0.16 |
    Catalyst::Plugin::StackTrace 0.11 |
    '----------------------------------------------------------------------------'

    [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [debug] Loaded engine "Catalyst::Engine::HTTP"
    [debug] Found home "/home/nick/catut/MyApp"
    [debug] Setting up auth realm default
    [debug] Loaded Config "/home/nick/catut/MyApp/myapp.conf"
    [debug] Loaded components:
    .-----------------------------------------------------------------+----------.
    Class | Type |
    +-----------------------------------------------------------------+----------+
    MyApp::Controller::Books | instance |
    MyApp::Controller::Login | instance |
    MyApp::Controller::Logout | instance |
    MyApp::Controller::Root | instance |
    MyApp::Model::DB | instance |
    MyApp::Model::DB::AppAction | class |
    MyApp::Model::DB::AppRole | class |
    MyApp::Model::DB::AppSession | class |
    MyApp::Model::DB::AppUser | class |
    MyApp::Model::DB::AppUserRole | class |
    MyApp::Model::DB::Author | class |
    MyApp::Model::DB::Book | class |
    MyApp::Model::DB::BookAuthor | class |
    MyApp::View::HTML | instance |
    '-----------------------------------------------------------------+----------'

    [debug] Loaded Private actions:
    .----------------------+--------------------------------------+--------------.
    Private | Class | Method |
    +----------------------+--------------------------------------+--------------+
    /error_noperms | MyApp::Controller::Root | error_noper- |
    ms |
    /default | MyApp::Controller::Root | default |
    /end | MyApp::Controller::Root | end |
    /index | MyApp::Controller::Root | index |
    /auto | MyApp::Controller::Root | auto |
    /logout/index | MyApp::Controller::Logout | index |
    /login/cheat2 | MyApp::Controller::Login | cheat2 |
    /login/doit | MyApp::Controller::Login | doit |
    /login/cheat1 | MyApp::Controller::Login | cheat1 |
    /login/index | MyApp::Controller::Login | index |
    /login/cheat | MyApp::Controller::Login | cheat |
    /login/get_sess | MyApp::Controller::Login | get_sess |
    /login/audit_log | MyApp::Controller::Login | audit_log |
    /login/list | MyApp::Controller::Login | list |
    /books/create | MyApp::Controller::Books | create |
    /books/show | MyApp::Controller::Books | show |
    /books/get_book_fro- | MyApp::Controller::Books | get_book_fr- |
    m_db | | om_db |
    /books/edit | MyApp::Controller::Books | edit |
    /books/bmodel | MyApp::Controller::Books | bmodel |
    /books/index | MyApp::Controller::Books | index |
    /books/list_recent | MyApp::Controller::Books | list_recent |
    /books/list_recent_- | MyApp::Controller::Books | list_recent- |
    tcp | | _tcp |
    /books/list | MyApp::Controller::Books | list |
    '----------------------+--------------------------------------+--------------'

    [debug] Loaded Path actions:
    .-------------------------------------+--------------------------------------.
    Path | Private |
    +-------------------------------------+--------------------------------------+
    / | /index |
    /books/ | /books/index |
    /login/ | /login/index |
    /login/cheat1/... | /login/cheat1 |
    /login/cheat2/... | /login/cheat2 |
    /login/doit/ | /login/doit |
    /login/list/... | /login/list |
    /logout/ | /logout/index |
    '-------------------------------------+--------------------------------------'

    [debug] Loaded Chained actions:
    .-------------------------------------+--------------------------------------.
    Path Spec | Private |
    +-------------------------------------+--------------------------------------+
    /books/create | /books/bmodel (0) |
    => /books/create |
    /books/id/*/edit | /books/bmodel (0) |
    -> /books/get_book_from_db (1) |
    => /books/edit |
    /books/list | /books/bmodel (0) |
    => /books/list |
    /books/list_recent/* | /books/bmodel (0) |
    => /books/list_recent |
    /books/list_recent_tcp/* | /books/bmodel (0) |
    => /books/list_recent_tcp |
    /books/id/*/show | /books/bmodel (0) |
    -> /books/get_book_from_db (1) |
    => /books/show |
    /... | /default |
    /error_noperms | /error_noperms |
    /login/id/*/audit_log | /login/get_sess (1) |
    => /login/audit_log |
    '-------------------------------------+--------------------------------------'

    [info] Cyberpaper Publishing powered by Catalyst 5.80033
    You can connect to your server at http://nickpad:3000
    [info] *** Request 1 (0.200/s) [12860] [Tue Sep 6 17:49:23 2011] ***
    [debug] "GET" request for "login/id/124/audit_log" from "127.0.0.1"
    [debug] Path is "/default"
    [debug] Arguments are "login/id/124/audit_log"
    [debug] Found sessionid "206cdb272c616ed8051c35d2679f10f433ec5120" in cookie
    [debug] Restored session "206cdb272c616ed8051c35d2679f10f433ec5120"
    [debug] Response Code: 404; Content-Type: text/html; charset=utf-8; Content-Length: 37
    [info] Request took 0.058598s (17.065/s)
    .------------------------------------------------------------+-----------.
    Action | Time |
    +------------------------------------------------------------+-----------+
    /auto | 0.000959s |
    /default | 0.000213s |
    /end | 0.036199s |
    '------------------------------------------------------------+-----------'


    --
    Nick
  • Dimitar Petrov at Sep 6, 2011 at 6:29 pm
    I've just tested both with Catalyst 5.90002 and 5.80032 seems to be just
    fine?
    Here is the output and the Login.pm controller.

    # Login controller
    package testapp::Controller::Login;
    use Moose;
    use namespace::autoclean;

    BEGIN { extends 'Catalyst::Controller' }

    sub get_sess :Chained('/') :PathPart('login/id') :CaptureArgs(1) {}
    sub audit_log :Chained('get_sess') :PathPart('audit_log') :Args(0) {}

    1;

    # Debug after getting /login/id/123/audit_log
    [info] testapp powered by Catalyst 5.80032
    [info] *** Request 1 (1.000/s) [19690] [Tue Sep 6 21:29:00 2011] ***
    [debug] "GET" request for "login/id/123/audit_log" from "127.0.0.1"
    [debug] Path is "/login/audit_log"
    [debug] Rendering template "login/audit_log"
    [debug] Response Code: 500; Content-Type: text/html; charset=utf-8;
    Content-Length: 6928
    [info] Request took 0.022136s (45.175/s)
    .------------------------------------------------------------+-----------.
    Action | Time |
    +------------------------------------------------------------+-----------+
    /login/get_sess | 0.000245s |
    /login/audit_log | 0.000110s |
    /end | 0.002664s |
    -> testapp::View::Web->process | 0.001542s |
    '------------------------------------------------------------+-----------'

    May be you should nopaste some more info.

    Cheers,
    Dimi
    On Tue, Sep 6, 2011 at 6:52 PM, Nick wrote:
    On 2011-09-06 17:33, Tomas Doran wrote:
    sub default : Chained('/') PathPart('') Args() {
    I made that change, but the default action still runs.
    New debug please?
    Sure,

    $ CATALYST_DEBUG=1 script/myapp_server.pl
    [debug] Debug messages enabled
    [debug] Statistics enabled
    [debug] Loaded plugins:

    .----------------------------------------------------------------------------.
    Catalyst::Plugin::Authentication 0.10017

    Catalyst::Plugin::Authorization::Roles 0.09

    Catalyst::Plugin::ConfigLoader 0.30

    Catalyst::Plugin::Session 0.31

    Catalyst::Plugin::Session::State::Cookie 0.17

    Catalyst::Plugin::Session::Store::DBI 0.16

    Catalyst::Plugin::StackTrace 0.11
    '----------------------------------------------------------------------------'

    [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [debug] Loaded engine "Catalyst::Engine::HTTP"
    [debug] Found home "/home/nick/catut/MyApp"
    [debug] Setting up auth realm default
    [debug] Loaded Config "/home/nick/catut/MyApp/myapp.conf"
    [debug] Loaded components:

    .-----------------------------------------------------------------+----------.
    Class | Type
    +-----------------------------------------------------------------+----------+
    MyApp::Controller::Books |
    instance |
    MyApp::Controller::Login |
    instance |
    MyApp::Controller::Logout |
    instance |
    MyApp::Controller::Root |
    instance |
    MyApp::Model::DB |
    instance |
    MyApp::Model::DB::AppAction | class

    MyApp::Model::DB::AppRole | class

    MyApp::Model::DB::AppSession | class

    MyApp::Model::DB::AppUser | class

    MyApp::Model::DB::AppUserRole | class

    MyApp::Model::DB::Author | class

    MyApp::Model::DB::Book | class

    MyApp::Model::DB::BookAuthor | class

    MyApp::View::HTML |
    instance |

    '-----------------------------------------------------------------+----------'

    [debug] Loaded Private actions:

    .----------------------+--------------------------------------+--------------.
    Private | Class | Method
    +----------------------+--------------------------------------+--------------+
    /error_noperms | MyApp::Controller::Root |
    error_noper- |
    ms
    /default | MyApp::Controller::Root | default

    /end | MyApp::Controller::Root | end

    /index | MyApp::Controller::Root | index

    /auto | MyApp::Controller::Root | auto

    /logout/index | MyApp::Controller::Logout | index

    /login/cheat2 | MyApp::Controller::Login | cheat2

    /login/doit | MyApp::Controller::Login | doit

    /login/cheat1 | MyApp::Controller::Login | cheat1

    /login/index | MyApp::Controller::Login | index

    /login/cheat | MyApp::Controller::Login | cheat

    /login/get_sess | MyApp::Controller::Login | get_sess

    /login/audit_log | MyApp::Controller::Login | audit_log

    /login/list | MyApp::Controller::Login | list

    /books/create | MyApp::Controller::Books | create

    /books/show | MyApp::Controller::Books | show

    /books/get_book_fro- | MyApp::Controller::Books |
    get_book_fr- |
    m_db | | om_db

    /books/edit | MyApp::Controller::Books | edit

    /books/bmodel | MyApp::Controller::Books | bmodel

    /books/index | MyApp::Controller::Books | index

    /books/list_recent | MyApp::Controller::Books | list_recent

    /books/list_recent_- | MyApp::Controller::Books |
    list_recent- |
    tcp | | _tcp

    /books/list | MyApp::Controller::Books | list
    '----------------------+--------------------------------------+--------------'

    [debug] Loaded Path actions:

    .-------------------------------------+--------------------------------------.
    Path | Private
    +-------------------------------------+--------------------------------------+
    / | /index

    /books/ | /books/index

    /login/ | /login/index

    /login/cheat1/... | /login/cheat1

    /login/cheat2/... | /login/cheat2

    /login/doit/ | /login/doit

    /login/list/... | /login/list

    /logout/ | /logout/index
    '-------------------------------------+--------------------------------------'

    [debug] Loaded Chained actions:

    .-------------------------------------+--------------------------------------.
    Path Spec | Private
    +-------------------------------------+--------------------------------------+
    /books/create | /books/bmodel (0)
    => /books/create
    /books/id/*/edit | /books/bmodel (0)
    -> /books/get_book_from_db (1)
    => /books/edit
    /books/list | /books/bmodel (0)
    => /books/list
    /books/list_recent/* | /books/bmodel (0)
    => /books/list_recent
    /books/list_recent_tcp/* | /books/bmodel (0)
    => /books/list_recent_tcp
    /books/id/*/show | /books/bmodel (0)
    -> /books/get_book_from_db (1)
    => /books/show
    /... | /default

    /error_noperms | /error_noperms

    /login/id/*/audit_log | /login/get_sess (1)
    => /login/audit_log
    '-------------------------------------+--------------------------------------'

    [info] Cyberpaper Publishing powered by Catalyst 5.80033
    You can connect to your server at http://nickpad:3000
    [info] *** Request 1 (0.200/s) [12860] [Tue Sep 6 17:49:23 2011] ***
    [debug] "GET" request for "login/id/124/audit_log" from "127.0.0.1"
    [debug] Path is "/default"
    [debug] Arguments are "login/id/124/audit_log"
    [debug] Found sessionid "206cdb272c616ed8051c35d2679f10f433ec5120" in
    cookie
    [debug] Restored session "206cdb272c616ed8051c35d2679f10f433ec5120"
    [debug] Response Code: 404; Content-Type: text/html; charset=utf-8;
    Content-Length: 37
    [info] Request took 0.058598s (17.065/s)
    .------------------------------------------------------------+-----------.
    Action | Time |
    +------------------------------------------------------------+-----------+
    /auto | 0.000959s |
    /default | 0.000213s |
    /end | 0.036199s |
    '------------------------------------------------------------+-----------'


    --
    Nick


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110906/846b56f1/attachment.htm
  • Will Crawford at Sep 6, 2011 at 9:09 pm
    On 6 September 2011 15:12, Nick wrote:
    ...
    ?[debug] "GET" request for "login/124/audit_log" from "127.0.0.1"
    ...

    Doesn't match /login/id/*/audit_log (missing the "id" path part).

    Sorry.

    :)
  • Nick at Sep 6, 2011 at 9:16 pm

    On 2011-09-06 22:09, Will Crawford wrote:
    On 6 September 2011 15:12, Nick wrote:
    ...
    ?[debug] "GET" request for "login/124/audit_log" from "127.0.0.1"
    ...

    Doesn't match /login/id/*/audit_log (missing the "id" path part).

    Sorry.

    :)
    No need to be sorry, my mistake. Unfortunately correcting it doesn't
    fix the problem, I still get the default page.
    --
    Nick
  • Nick at Sep 7, 2011 at 10:23 am

    On 2011-09-06 14:34, Nick wrote:
    Catalyst isn't dispatching how I expected. A 'Login' controller has
    I found the culprit. My controller uses this

    http://wiki.catalystframework.org/wiki/gettingstarted/howtos/HTTP_method_matching_for_actions

    which contains

    # Continue to action if no HTTP methods specified
    $self->$orig( @_ ) and return 0
    if ! $self->attributes->{Methods};

    Perhaps that should be

    # Continue to match if no HTTP methods specified
    return $self->$orig( @_ )
    if ! $self->attributes->{Methods};

    ?
    --
    Nick
  • Tomas Doran at Sep 7, 2011 at 10:34 am

    On 7 Sep 2011, at 11:23, Nick wrote:
    On 2011-09-06 14:34, Nick wrote:
    Catalyst isn't dispatching how I expected. A 'Login' controller has
    I found the culprit. My controller uses this

    http://wiki.catalystframework.org/wiki/gettingstarted/howtos/HTTP_method_matching_for_actions <snip>
    Perhaps that should be
    No, the wiki page should just point to
    Catalyst::ActionRole::MatchRequestMethod, which already does this
    correctly.

    Please fix? :)

    Cheers
    t0m
  • Nick at Sep 7, 2011 at 11:20 am

    No, the wiki page should just point to
    Catalyst::ActionRole::MatchRequestMethod, which already does this
    correctly.
    Yes that works.
    Please fix? :)
    OK

    --
    Nick

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedSep 6, '11 at 1:34p
activeSep 7, '11 at 11:20a
posts15
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase