Unable to get default working with haxe.Web.Dispatch
I am currently setting up a website using haxe targetting php and I'm
having a problem with the haxe.Web.Dispatch library.
Everything was working well until I tried to implement a doDefault() rule.
I have the following rules in my dispatch api:
doIndex(){ ... }
doPosts(){y:String, m:String, n:String){ ... }
And these will both redirect to the correct webpage. For example these
both work fine:
http://foo.com/index
http://foo.com/posts/2013/01/post-title
And now I've implemented
doDefault() {...}
in order to redirect any other urls to a 404 page, but it's not working.
Going to the above URLs still works fine but going to
http://foo.com/bar
gives the following error
uncaught exception: DETooManyValues
in file: C:\wamp\www\website\bin\lib\haxe\web\Dispatch.class.php line 191
#0 C:\wamp\www\website\bin\lib\Index.class.php(9):
haxe_web_Dispatch->runtimeDispatch(Object(_hx_anonymous))
#1 C:\wamp\www\website\bin\lib\Index.class.php(12): Index->__construct()
#2 C:\wamp\www\website\bin\index.php(9): Index::main()
#3 {main}
The Dispatch documentation says
In case the corresponding method doXXXX is not found on the api object, or
if the URL is /, the action doDefault is used instead. An exception
DispatchError.DENotFound("XXXX") is thrown if there is no default action
(XXXX here being the placeholder for the URL part name).
but it doesn't say anything about the DETooManyValues exception. Anyone
have any ideas?
No comments:
Post a Comment