Page handler url matching problem

10 views
Skip to first unread message

Voltron

unread,
Oct 26, 2009, 4:33:04 PM10/26/09
to cherrypy-users
I have an application mounted as test. This has a page handler called
foo. I cant seem to get the default handler to match this URL.:

http://localhost:8080/test/foo?action=new

This was the handler I used:

@cherrypy.expose
def default(self, *args, **kwargs ):


This always error out with this traceback:

Traceback (most recent call last):
File "C:\Python26\lib\site-packages\cherrypy\_cprequest.py", line
606, in respond
cherrypy.response.body = self.handler()
File "C:\Python26\lib\site-packages\cherrypy\_cpdispatch.py", line
27, in __call__
test_callable_spec(self.callable, self.args, self.kwargs)
File "C:\Python26\lib\site-packages\cherrypy\_cpdispatch.py", line
130, in test_callable_spec
"parameters: %s" % ", ".join(extra_qs_params))
HTTPError: (404, 'Unexpected query string parameters: action')

Is there something I am missing?

Thanks


dundeemt

unread,
Nov 8, 2009, 10:01:56 AM11/8/09
to cherrypy-users
--code--
class MyRouter2:
@cherrypy.expose
def default(self, *args, **kwargs):
return '[%s]:[%s]' % (args,kwargs)

cherrypy.tree.mount(MyRouter2(), "/", None)
cherrypy.engine.start()
cherrypy.engine.block()

--request--
http://localhost:8080/test/foo?action=new

--response--
[('test', 'foo')]:[{'action': 'new'}]

--version info--
cherrypy 3.1.2
python 2.6.2

working here

Best,
Jeff
Reply all
Reply to author
Forward
0 new messages