Recent

Author Topic: fcl-web/fpWeb -- cannot invoke different actions  (Read 3118 times)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
fcl-web/fpWeb -- cannot invoke different actions
« on: March 23, 2014, 01:41:50 am »
Hi All,
I am trying to set multiple actions on a CGI app without success - only one action is triggered according to the setting in the OnRequest property of the object (looks like properties defined in actions are not considered).
Please advise what I am not doing right.
Basically regardless of how I am calling the action, the default OnRequest action is triggered.
http://localhost:8080/cgi-bin/test01.cgi/customers/Read
http://localhost:8080/cgi-bin/test01.cgi/customers/Hour

If the OnRequest action is left unpopulated there is an error in the response from the web server.

Attached please find the code and screen captures from Object Inspector.

Environment:
OS: Windows XP 32 bits
Lazarus 1.2
Apache 2.0.65.200
fpweb\weblaz.lpk - 0.0

Thank you,


Lazarus 2.0.2 64b on Debian LXDE 10

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: fcl-web/fpWeb -- cannot invoke different actions
« Reply #1 on: April 09, 2014, 02:28:34 pm »
I'm not an expert on fpweb at all but am still working on a RESTful server.

I've got
Code: [Select]
  Application.AllowDefaultModule:=false; //all URLs must include the module name (image, document..)
  { If there is only 1 element in the URL, like the "something" in
    http://localhost/cgi-bin/something
    treat it as a module by setting PreferModuleName.
    Otherwise it would have been treated like an action.
  }
  Application.PreferModuleName:=true;
and then use various modules like this
Code: [Select]
initialization
  // This registration will handle http://server/cgi-bin/tigercgi/image/*
  RegisterHTTPModule('image', TFPWebimage);
end.
and
Code: [Select]
initialization
  // This registration will handle http://server/cgi-bin/tigercgi/document/*
  RegisterHTTPModule('document', TFPWebdocument);
end.

I basically do everything in code in those modules

See the tigercgi.lpr project in my papertiger project (repository via link below)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018