'Dispatch an incoming request.'

def dispatch_request(self, environ, start_response):

    self.bind_to_context()
    request = Request(environ)
    request.bind_to_context()
    action_name = (request.args.get('action') or 'show')
    page_name = u'_'.join([x for x in request.path.strip('/').split() if x])
    if (not page_name):
        response = redirect(href('Main_Page'))
    elif page_name.startswith('Special:'):
        if (page_name[8:] not in pages):
            response = page_not_found(request, page_name)
        else:
            response = pages[page_name[8:]](request)
    else:
        action = getattr(actions, ('on_' + action_name), None)
        if (action is None):
            response = actions.missing_action(request, action_name)
        else:
            response = action(request, page_name)
    return ClosingIterator(response(environ, start_response), session.remove)
