Issue with routes and invalid registered event

73 views
Skip to first unread message

rufi...@gmail.com

unread,
Mar 3, 2009, 9:10:18 PM3/3/09
to ColdBox Framework
I am just getting started with ColdBox, trying to use a custom route
with an event handler. My config/routes.cfm looks like this:

<cfset addCourse(pattern="/people/:person_id", handler="users",
action="show")>
<cfset addCourse(":handler/:action?/:id?")>

(yes, making sure to put my custom route above the catch-all one)

I have a "handlers/users.cfc" with a "show" function.

So when I request a path such as "/index.cfm/people/23" I get this
error:

The event handler: people.23 is not valid registered event.

I would think that it would work just fine and the requestContext
object would allow me to access the "person_id" variable.

What am I missing?

I do have the proper interceptor enabled in coldspring.xml.cfm

<Interceptor class="coldbox.system.interceptors.ses">
<Property name="configFile">config/routes.cfm</Property>
</Interceptor>

Thanks in advance.

Rupert Fiasco

unread,
Mar 3, 2009, 9:13:05 PM3/3/09
to ColdBox Framework
I just answered my own question: it turns out that in my routes.cfm
file in the pattern I started it with a leading slash
("/people/:person_id") and that was causing this error to happen. If I
remove the leading slash, all is well.

Hmm, that was a subtle one, maybe put this in the documentation?

Luis Majano

unread,
Mar 4, 2009, 11:19:24 AM3/4/09
to col...@googlegroups.com
Yea, that seems weird.

I will check it and make a note of it.
--
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldboxframework.com
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Sana

unread,
Mar 4, 2009, 11:54:14 AM3/4/09
to ColdBox Framework
Luis,

Just double checked this behavior.

http://www.abc.com/help ROUTE "/help" does not work if there any
forward slash before route-string

Thanks
Sana

On Mar 4, 4:19 pm, Luis Majano <lmaj...@gmail.com> wrote:
> Yea, that seems weird.
> I will check it and make a note of it.
>
>
>
> On Tue, Mar 3, 2009 at 6:13 PM, Rupert Fiasco <rufia...@gmail.com> wrote:
>
> > I just answered my own question: it turns out that in my routes.cfm
> > file in the pattern I started it with a leading slash
> > ("/people/:person_id") and that was causing this error to happen. If I
> > remove the leading slash, all is well.
>
> > Hmm, that was a subtle one, maybe put this in the documentation?
>
> > On Tue, Mar 3, 2009 at 6:10 PM, rufia...@gmail.com <rufia...@gmail.com>

Luis Majano

unread,
Mar 4, 2009, 12:43:07 PM3/4/09
to col...@googlegroups.com
Yea, that seemed strange. Anyways, I have logged a bug for it to do pre route cleanup of the "/".
Reply all
Reply to author
Forward
0 new messages