Recent

Author Topic: Changing webmodule's name  (Read 1653 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1289
Changing webmodule's name
« on: January 30, 2018, 09:52:42 am »

Hi,

When I create an CGI (or FCGI) application, unit1 is automatically created as well.
If I change the name of the module (e.g. from FPWebModule1 to fpwm1) at the object inspector,  the type name is changed to Tfpwm1 as follows.

Code: Pascal  [Select][+][-]
  1.  
  2. type
  3.  
  4.   { Tfpwm1 }
  5.  
  6.   Tfpwm1 = class(TFPWebModule)
  7.     procedure DataModuleAfterInitModule(Sender: TObject; ARequest: TRequest);
  8.    .......
  9.   end;
  10.  
  11.   var
  12.     fpwm1: Tfpwm1;
  13.  
  14.  

But in the initialization section, the name within quotations are not changed as follows.
Is this OK? Doesn't this mean that if I write many web module programs, they are RegisterHTTPModuled with the same name?

Code: Pascal  [Select][+][-]
  1. initialization
  2.   RegisterHTTPModule('TFPWebModule', Tfpwm1);

Or may I change like:

Code: Pascal  [Select][+][-]
  1. initialization
  2.   RegisterHTTPModule('Tfpwm1', Tfpwm1);


Regards,


Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Changing webmodule's name
« Reply #1 on: January 30, 2018, 07:19:10 pm »
When you make a request, the module matching that registered name will handle it. I forget what the behavior is, but registering multiple modules with the same name will not work, either only one module will always handle the request or something worse.

 

TinyPortal © 2005-2018