RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMultiModuleWebAppServices.InitContext Method

Creates and initializes the Web context for the current Web request.

Pascal
procedure InitContext(WebModuleList: TAbstractWebModuleList; Request: TWebRequest; Response: TWebResponse);
C++
__fastcall InitContext(TAbstractWebModuleList WebModuleList, TWebRequest Request, TWebResponse Response);

InitContext is called when the WebSnap application first receives a request message to set up the Web context before the application attempts to handle the request. It creates and sets up the global Web context, which can be accessed by calling the global WebContext function. It also performs any other initializations that ready the application for handling a new request message. 

WebModuleList lists the currently active Web modules in the WebSnap application and provides access to all Web module factories so that the application can create any new modules it needs for processing the request message. This becomes the value of the WebModules property. 

Request describes the new request message. This becomes the value of the Request property. 

Response is the response object that the WebSnap application should fill out when handling the current request. This becomes the value of the Response property. 

InitContext is not a virtual method. Descendant classes can't override this method to add additional initializations. Instead, InitContext calls the virtual ImplInitContext method, which descendant classes override to add their own initial tasks. 

 

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