Web.HTTPApp.TWebActionItem.Default

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Default: Boolean read FDefault write SetDefault default False;

C++

__property bool Default = {read=FDefault, write=SetDefault, default=0};

Properties

Type Visibility Source Unit Parent
property published
Web.HTTPApp.pas
Web.HTTPApp.hpp
Web.HTTPApp TWebActionItem

Description

Indicates whether the action item should handle any request that is not handled by another available action item.

Set Default to true to make this action item the default action in the list of action items maintained by the TWebDispatcher object. TWebDispatcher attempts to match HTTP request messages to action items by matching the MethodType and PathInfo of the target URI. If no match can be found, the TWebDispatcher invokes the default action item, regardless of its MethodType or PathInfo properties.

When an action item is chosen as the default action item, the value of its Enabled property is ignored. Thus, if an action item sets Enabled to false and Default to true, TWebDispatcher will first look for a match with any other action item, even if the PathInfo and MethodType of the default action item match the request perfectly. Then, only after all other action items have been rejected, TWebDispatcher selects the default action item. If the default action item is enabled, it may be selected before all other action items have been considered because the MethodType and PathInfo match the request.

The default action item must be prepared to generate a response to any HTTP request, for any MethodType and PathInfo. This may consist of simply setting a response status code of 404 (the URI could not be matched) or 405 (the requested method is not supported).

Setting Default to true sets the Default property of the previous default action item to false.

See Also