RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWebModule.BeforeDispatch Event

Occurs before the dispatcher tries to match the HTTP request message with any of its action items.

Pascal
property BeforeDispatch: THTTPMethodEvent;
C++
__property THTTPMethodEvent BeforeDispatch;

Write a BeforeDispatch event handler to preprocess all HTTP request messages. A BeforeDispatch event handler can enable or disable the action items appropriate to the response, begin filling out the response object, or provide any other necessary preprocessing.  

If the BeforeDispatch event handler finishes filling out the response object, it should change the Handled parameter to True so the dispatcher will not send the request on to any of the action items. If the BeforeDispatch event handler sends the response message, the dispatcher will not pass the request on to any of the action items, even if the Handled parameter is left as False. 

If the BeforeDispatch event handler sets the Handled parameter to True but does not send the response, the Web dispatcher will generate an AfterDispatch event. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!