TWebHandler class
Base class for handling HTTP requests in web applications
Declaration
TWebHandler = class(TComponent)Inheritance
- TWebHandler
- TComponent
- TPersistent
- TObject
Description
TWebHandler is the core component that handles HTTP requests in web applications.
It provides the framework for routing requests to appropriate HTTP modules, handling errors, and managing the request-response cycle.
This class serves as the foundation for all HTTP hosting implementations including CGI, FastCGI, HTTP server and Apache modules.
The handler supports both legacy routing and new HTTP routing systems, module lifecycle management, error handling with custom exception display, and event logging.
Errors
May raise HTTP-related exceptions during request processing.
See also
Properties
Terminated | protected | |
HandleGetOnPost | public | Controls whether GET requests are handled by POST handlers |
RedirectOnError | public | Controls whether errors trigger HTTP redirects |
RedirectOnErrorURL | public | URL template for error redirects |
ApplicationURL | public | Base URL for the web application |
AllowDefaultModule | public | Controls whether requests without module names use default modules |
DefaultModuleName | public | Name of the default HTTP module for requests without explicit module names |
ModuleVariable | public | Query parameter name for specifying HTTP module names |
Email | public | Administrator email address for error notifications |
Title | public | Application title displayed in error pages |
Administrator | public | Administrator name for error pages |
PreferModuleName | public | Controls whether module name extraction is preferred over path info parsing |
LegacyRouting | public | Controls whether to use legacy request routing instead of HTTP router |
IncludeStackTraceInErrorPage | public |
Methods
DoError | protected | |
Terminate | protected | |
GetModuleName | protected | |
WaitForRequest | protected | |
EndRequest | protected | |
FindModule | protected | |
SetBaseURL | protected | |
GetApplicationURL | protected | |
ShowRequestException | protected | |
InitRequest | protected | |
InitResponse | protected | |
GetEmail | protected | |
GetAdministrator | protected | |
Create | public | Creates a new web handler instance |
Destroy | public | Destroys the web handler instance |
Run | public | Main request processing loop for the web handler |
Log | public | Logs an event message using the configured log handler |
DoHandleRequest | public | Handles a complete HTTP request with error handling and cleanup |
HandleRequest | public | Routes and processes an HTTP request to the appropriate handler |
Events
OnGetModule | public | Event for custom module selection logic |
OnShowRequestException | public | Event for custom exception handling during request processing |
OnIdle | public | Event triggered when the handler is idle between requests |
OnLog | public | Event for logging web application events and errors |
OnUnknownRequestEncoding | public | Event for handling unknown request content encodings |
OnInitModule | public | Event for initializing HTTP modules before request processing |
Inherited
From TComponent (74)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (5)
Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (37)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
