RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomWebDispatcher.DoBeforeDispatch Method

Generates a BeforeDispatch event and returns a value that indicates whether the dispatcher should look for action items to handle the request.

Pascal
function DoBeforeDispatch(Request: TWebRequest; Response: TWebResponse): Boolean;
C++
__fastcall Boolean DoBeforeDispatch(TWebRequest Request, TWebResponse Response);

Applications cannot call DoBeforeDispatch. The DispatchAction method calls DoBeforeDispatch before trying to match the HTTP request message with any of its action items.  

If the BeforeDispatch event handler indicates that it has handled the request message, DoBeforeDispatch returns true, and the DispatchAction method does not try to pass the request message to any of the action items. Otherwise, DoBeforeDispatch returns false, and unless the response message was sent from within the BeforeDispatch event handler, the DispatchAction method proceeds with looking for action items to handle the request message. 

If DoBeforeDispatch returns true but the response has not been sent, DispatchAction generates an AfterDispatch event. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!