[Catalyst] Dispatching not working as expected.

Ian.Docherty at nomura.com Ian.Docherty at nomura.com
Thu May 12 12:38:38 GMT 2011


-----Original Message-----
From: Tomas Doran [mailto:bobtfish at bobtfish.net] 
Sent: 12 May 2011 13:02
To: The elegant MVC web framework
Subject: Re: [Catalyst] Dispatching not working as expected.


On 12 May 2011, at 10:29, <Ian.Docherty at nomura.com> <Ian.Docherty at nomura.com 
 > wrote:
> All the above work correctly, with the exception of '/pod/*' which  
> dispatches
> as if it were '/*/*'.
>
> My understanding is that the most specific should be chosen first,  
> so '/pod/*'
> should be chosen in preference to '/*/*'?

This will happen if you have multiple possible chained matches.

However you have one set of chained matches, and one set of Path  
matches - so the result is pretty undefined.

I'd recommend you change your pod controller over to also use Chained,  
then I think you'll find things more likely to work as you expect.

Cheers
t0m

t0m
Thanks for that suggestion, and I see where you are coming from, I changed
my pod controller as follows, but it has the same problem.

----------

sub pod : Chained('') PathPart('') CaptureArgs(0) {
    my ($self, $c) = @_;
}

sub pod_without_arg :Chained('pod') :PathPart('') :Args(0) {
    my ($self, $c) = @_;
    $c->response->body( "pod_without_arg" );
}

sub pod_with_arg :Chained('pod') :PathPart('') :Args(1) {
    my ($self, $c, $file) = @_;
    $c->response->body( "pod_with_arg - file = $file" );
}




This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm




More information about the Catalyst mailing list