Package trac :: Package web :: Module main :: Class RequestDispatcher

Class RequestDispatcher

source code

    object --+    
             |    
core.Component --+
                 |
                RequestDispatcher

Web request dispatcher.

This component dispatches incoming requests to registered handlers. Besides, it also takes care of user authentication and request pre- and post-processing.

Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
 
configurable_headers(...)
Headers to be added to the HTTP request.
source code
 
authenticate(self, req) source code
 
dispatch(self, req)
Find a registered handler that matches the request and let it process it.
source code
 
get_htdocs_dirs(self) source code
 
get_templates_dirs(self) source code
 
set_default_callbacks(self, req)
Setup request callbacks for lazily-evaluated properties.
source code

Inherited from core.Component: __repr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods

Inherited from core.Component: implements

Class Variables
  required = True
  filters = <OrderedExtensionsOption [trac] 'request_filters'>
  default_handler = <ExtensionOption [trac] 'default_handler'>
  default_timezone = <Option [trac] 'default_timezone'>
  default_language = <Option [trac] 'default_language'>
  default_date_format = <ChoiceOption [trac] 'default_date_format'>
  use_xsendfile = <BoolOption [trac] 'use_xsendfile'>
  xsendfile_header = <Option [trac] 'xsendfile_header'>
Properties
  authenticators
List of components that implement ~trac.web.api.IAuthenticator
  handlers
List of components that implement ~trac.web.api.IRequestHandler

Inherited from object: __class__

Method Details

configurable_headers(...)

source code 

Headers to be added to the HTTP request. (''since 1.2.3'')

The header name must conform to RFC7230 and the following reserved names are not allowed: content-type, content-length, location, etag, pragma, cache-control, expires.

dispatch(self, req)

source code 

Find a registered handler that matches the request and let it process it.

In addition, this method initializes the data dictionary passed to the the template and adds the web site chrome.


Property Details

authenticators

List of components that implement ~trac.web.api.IAuthenticator
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.

handlers

List of components that implement ~trac.web.api.IRequestHandler
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.