When the dispatcher receives the client request, it generates a BeforeDispatch event. This provides your application with a chance to preprocess the request message before it is seen by any of the action items.
Next, the dispatcher iterates over its list of action items, looking for an entry that matches the PathInfo portion of the request message's target URL and that also provides the service specified as the method of the request message. It does this by comparing the PathInfo and MethodType properties of the TWebRequest object with the property of the same name on the action item.
When the dispatcher finds an appropriate action item, it causes that action item to fire. When the action item fires, it does one of the following:
If, after checking all the action items and any specially registered auto-dispatching components, the request message has still not been fully handled, the dispatcher calls the default action item. The default action item does not need to match either the target URL or the method of the request.
If the dispatcher reaches the end of the action list (including the default action, if any) and no actions have been triggered, nothing is passed back to the server. The server simply drops the connection to the client.
If the request is handled by the action items, the dispatcher generates an AfterDispatch event. This provides a final opportunity for your application to check the response that was generated, and make any last minute changes.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|