Page handler url matching problem

View: New views
2 Messages — Rating Filter:   Alert me  

Page handler url matching problem

by Voltron-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Page handler url matching problem

by Jeff H-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


--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

On Oct 26, 2:33 pm, Voltron <nhy...@...> wrote:

> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---