[Catalyst] Form handling, urls and web design

Brandon Black blblack at gmail.com
Tue Jan 24 12:22:10 CET 2006


On 1/24/06, Alex Kavanagh <alex at tinwood.homelinux.org> wrote:
> At Mon, 23 Jan 2006 15:47:40 -0800,
> Bill Moseley wrote:
> > I stay away from default.  Use an empty path instead.
>
> Why do you stay away from default?
>

I still haven't rid my code of using default like that myself, but I
think he's probably right about staying away from it being a Good Idea
in general.  default will match anything, so you've made a whole class
of mis-spelled URLs suddenly valid.  A typo (by the user or in your
app) like "/myapp/users/dlete_user" should not map to a default sub
which then implements or redirects to a list, but should rather give a
proper 404 error.  And for a real action on "/myapp/users" implemented
within users.pm, I believe the syntax is like:

sub users_root : Path {
    ...
}

-- Brandon



More information about the Catalyst mailing list