[Catalyst] Form handling, urls and web design

Alex Kavanagh alex at tinwood.homelinux.org
Tue Jan 24 19:52:59 CET 2006


At Tue, 24 Jan 2006 05:22:10 -0600,
Brandon Black wrote:
> 
> 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 {
>     ...
> }

Ah, all is clear.  Thanks.  I will switch my default to 404 equivalent
and use the empty Path from now on.

Cheers

-- 
Alex.



More information about the Catalyst mailing list