Sign in Join
FPDoc Onlineexperiment

TWebHandler class

In unit CustWeb

Base class for handling HTTP requests in web applications

Declaration

pascal
TWebHandler = class(TComponent)

Inheritance

  1. TWebHandler
  2. TComponent
  3. TPersistent
  4. 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

Terminatedprotected
HandleGetOnPostpublicControls whether GET requests are handled by POST handlers
RedirectOnErrorpublicControls whether errors trigger HTTP redirects
RedirectOnErrorURLpublicURL template for error redirects
ApplicationURLpublicBase URL for the web application
AllowDefaultModulepublicControls whether requests without module names use default modules
DefaultModuleNamepublicName of the default HTTP module for requests without explicit module names
ModuleVariablepublicQuery parameter name for specifying HTTP module names
EmailpublicAdministrator email address for error notifications
TitlepublicApplication title displayed in error pages
AdministratorpublicAdministrator name for error pages
PreferModuleNamepublicControls whether module name extraction is preferred over path info parsing
LegacyRoutingpublicControls whether to use legacy request routing instead of HTTP router
IncludeStackTraceInErrorPagepublic

Methods

DoErrorprotected
Terminateprotected
GetModuleNameprotected
WaitForRequestprotected
EndRequestprotected
FindModuleprotected
SetBaseURLprotected
GetApplicationURLprotected
ShowRequestExceptionprotected
InitRequestprotected
InitResponseprotected
GetEmailprotected
GetAdministratorprotected
CreatepublicCreates a new web handler instance
DestroypublicDestroys the web handler instance
RunpublicMain request processing loop for the web handler
LogpublicLogs an event message using the configured log handler
DoHandleRequestpublicHandles a complete HTTP request with error handling and cleanup
HandleRequestpublicRoutes and processes an HTTP request to the appropriate handler

Events

OnGetModulepublicEvent for custom module selection logic
OnShowRequestExceptionpublicEvent for custom exception handling during request processing
OnIdlepublicEvent triggered when the handler is idle between requests
OnLogpublicEvent for logging web application events and errors
OnUnknownRequestEncodingpublicEvent for handling unknown request content encodings
OnInitModulepublicEvent 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.