TCustomWebApplication¶
Base class for web applications with integrated request handling
Declaration¶
Source position: custweb.pp line 117
type
TCustomWebApplication = class(TCustomApplication)
public
constructor Create;
destructor Destroy;
procedure CreateForm;
procedure Initialize;
procedure Terminate;
property HandleGetOnPost: Boolean; {rw}
property RedirectOnError: Boolean; {rw}
property RedirectOnErrorURL: string; {rw}
property ApplicationURL: string; {rw}
property AllowDefaultModule: Boolean; {rw}
property DefaultModuleName: string; {rw}
property ModuleVariable: string; {rw}
property OnGetModule: TGetModuleEvent; {rw}
property Email: string; {rw}
property Administrator: string; {rw}
property OnShowRequestException: TOnShowRequestException; {rw}
property OnUnknownRequestEncoding: TOnUnknownEncodingEvent; {rw}
property EventLog: TEventLog; {r}
property PreferModuleName: Boolean; {rw}
property LegacyRouting: Boolean; {rw}
property IncludeStackTraceInErrorPage: Boolean; {rwd}
end;
Description¶
TCustomWebApplication extends TCustomApplication to provide web-specific functionality. It integrates a TWebHandler instance for processing HTTP requests and provides properties for configuring web application behavior.
This class serves as the foundation for all web application implementations including CGI, FastCGI, and other HTTP hosting environments. It handles application lifecycle, event logging, and web handler management.
Properties¶
| Member | Visibility | Description |
|---|---|---|
| Administrator | public | Administrator name for error pages |
| AllowDefaultModule | public | Controls whether requests without module names use default modules |
| ApplicationURL | public | Base URL for the web application |
| DefaultModuleName | public | Name of the default HTTP module |
| public | Administrator email address for error notifications | |
| EventLog read only | public | Event log instance for logging web application events |
| HandleGetOnPost | public | Controls whether GET requests are handled by POST handlers |
| IncludeStackTraceInErrorPage | public | |
| LegacyRouting | public | Controls whether to use legacy request routing |
| ModuleVariable | public | Query parameter name for specifying HTTP module names |
| PreferModuleName | public | Controls module name extraction preference |
| RedirectOnError | public | Controls whether errors trigger HTTP redirects |
| RedirectOnErrorURL | public | URL template for error redirects |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| Create | public | Creates and initializes a new web application instance |
| CreateForm | public | Creates a component instance with the web handler as owner |
| Destroy | public | Destroys the web application and cleans up resources |
| Initialize | public | Initializes the web application with error handling enabled |
| Terminate | public | Terminates the web application and web handler |
Events¶
| Member | Visibility | Description |
|---|---|---|
| OnGetModule | public | Event for custom module selection logic |
| OnShowRequestException | public | Event for custom exception handling during request processing |
| OnUnknownRequestEncoding | public | Event for handling unknown request content encodings |
Errors¶
May raise exceptions during web handler initialization or request processing.
See also¶
| Name | Description |
|---|---|
| TWebHandler | Base class for handling HTTP requests in web applications |