Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:50:30+00:00 2026-05-31T22:50:30+00:00

I have an ISAPI Application in Delphi 6 that uses WebBroker. I need to

  • 0

I have an ISAPI Application in Delphi 6 that uses WebBroker. I need to add logging information at the beggining and the end of each Action.

I have tried OnBeforeDispatch and OnAfterDispatch, but some actions sent the response directly to the browser and the OnAfterDispatch event is never fired.

Is there a way to add a filter or something without having to add code to each action?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:50:32+00:00Added an answer on May 31, 2026 at 10:50 pm

    One way you can do that is to have only one action. Set the path to “/” and action as default handler. Then:

    1. log the start of action
    2. From the URL call the appropriate inner handler you specified
    3. Log the end of action

    I always do an action handler engine that has all actions registered. Then the code is like this

    procedure TwmWebModule.wmWebModuleActionHandlerAction(Sender: TObject;
                                                          Request: TWebRequest;
                                                          Response: TWebResponse;
                                                          var Handled: Boolean);
    var
      HandlerID: string;
    begin
      HandlerID := StringReplace(string(Request.InternalPathInfo), '/', '', []);
      FHandlerEngine.ExecuteHandler(HandlerID, Request, Response);
    end;
    

    Now just add logging 🙂 This has other benefits. Every handler is then in its own unit and you achieve the MVC approach of a kind. The code is a lot cleaner and more maintainable.

    The skeleton looks like this:

      TCustomHandler = class
      private
        FHandlerID: string;
        FHandlerSettings: ISimpleStorage;
      protected
        procedure Execute(const Request: TWebRequest; const Response: TWebResponse); virtual; abstract;
      public
        constructor Create(const ID: string);
        property HandlerID: string read FHandlerID;
        property HandlerSettings: ISimpleStorage read FHandlerSettings;
      end;
    
      THandlerEngine = class
      private
        FHandlersList: TObjectList;
        FRegisteredHandlers: THashTable;
      protected
      public
        constructor Create;
        destructor Destroy; override;
        procedure RegisterHandlers;
        procedure AddSingleHandler(const ID: string; const Handler: TCustomHandler);
        procedure ExecuteHandler(const ID: string; const Request: TWebRequest; const Response: TWebResponse);
      end;
    

    You should be able to understand the principle from all this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application we bought that I need to integrate, and it uses
We have a Delphi 7 application that runs as an ISAPI extension in IIS6.
I have developed an isapi web service in delphi 7 and I need to
I have developed a Delphi web server application (TWebModule). It runs as a ISAPI
I have a delphi (Win32) web application that can run either as a CGI
I have an old isapi application that I am now replacing with a new
I have an ISAPI filter that I am using to do URL rewriting for
We have a .net 3.5 application (MVC and WebForms mixed) that was hosted on
I have created several websites that run from ISAPI dll's, which runs smoothly in
I have a classic asp webapp that I need to implement url re-writing in.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.