RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWebApplication Class

TWebApplication encapsulates a Web server application.

Pascal
TWebApplication = class(TWebRequestHandler);
C++
class TWebApplication : public TWebRequestHandler;

TWebApplication provides the fundamental behavior of a Web server application. TWebApplication provides methods to create TWebRequest and TWebResponse objects that represent HTTP request messages and their responses, pass these objects to the dispatcher so that the response can be filled in, and send the response back to the Web client. 

Each Web server project automatically declares an Application variable of type TWebApplication as the instance of the application. For CGI applications, this variable is initialized to a TCGIApplication object in the CGIApp unit. For Apache applications, this variable is initialized to a TApacheApplication object in the ApacheApp unit. For ISAPI applications, this variable is initialized to a TISAPIApplication object in the ISAPIApp unit.  

The Application variable is added to a project by selecting File | New from the menu of the IDE main window and selecting Web Server Application in the New Items dialog. Do not add the Forms unit to the uses list of the project (Delphi) or include Forms.hpp in the project source file (C++). These actions declare a conflicting Application variable of type TApplication.In addition, do not add the ApacheApp or ISAPIApp unit to a CGI application or the CGIApp unit to an Apache, ISAPI or NSAPI application. The CGIApp unit, the ISAPIApp unit, and the ApacheApp unit each create the initial instance of the Application variable. Including more than one of these units in the uses list causes the memory for the object created in the first unit to be lost. 

 

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