Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-03

fpWeb: Error when trying to call a module without an action

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sven Barth

Hello together!

As I already said on fpc-devel I'm currently playing around with fcl-web and hit the next problem: I successfully managed to build and run my first module, but when I added a second one I got an error when I use the following URL to call my module (of which one is registered as "treenode"):

http://localhost:4321/treenode

The given error is:

Could not determine HTTP module for request ""

It works correctly if I supply the name of the default action "list" (or any other registered action). E.g. the following returns the desired content:

http://localhost:4321/treenode/list

I'm using the embedded webserver variant and the error only surfaced after I added a second module which let's me assume that the problem is the same as this:
http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-June/063655.html

Regards,
Sven

Reply by email

Unknown author
to Sven Barth
Sven Barth wrote 22 lines
Hello together! As I already said on fpc-devel I'm currently playing around with fcl-web and hit the next problem: I successfully managed to build and run my first module, but when I added a second one I got an error when I use the following URL to call my module (of which one is registered as "treenode"): http://localhost:4321/treenode The given error is: Could not determine HTTP module for request "" It works correctly if I supply the name of the default action "list" (or any other registered action). E.g. the following returns the desired content: http://localhost:4321/treenode/list I'm using the embedded webserver variant and the error only surfaced after I added a second module which let's me assume that the problem is the same as this: http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-June/063655.html

And what exactly is the problem ?

You can set the default module name in the TFPWebApplication. But in that case, the path is interpreted as the action to execute, so the correct URL would be

http://localhost:4321/list

to have the module first requires an additional property and patch. This is planned.

Michael.

Reply by email

Sven Barth
to Unknown author

Am 09.03.2012 15:09, schrieb

Show quoted text 40 lines
On Fri, 9 Mar 2012, Sven Barth wrote: > Hello together! > > As I already said on fpc-devel I'm currently playing around with > fcl-web and hit the next problem: I successfully managed to build and > run my first module, but when I added a second one I got an error when > I use the following URL to call my module (of which one is registered > as "treenode"): > > http://localhost:4321/treenode > > The given error is: > > Could not determine HTTP module for request "" > > It works correctly if I supply the name of the default action "list" > (or any other registered action). E.g. the following returns the > desired content: > > http://localhost:4321/treenode/list > > I'm using the embedded webserver variant and the error only surfaced > after I added a second module which let's me assume that the problem > is the same as this: > http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-June/063655.html > And what exactly is the problem ? You can set the default module name in the TFPWebApplication. But in that case, the path is interpreted as the action to execute, so the correct URL would be http://localhost:4321/list to have the module first requires an additional property and patch. This is planned.

So it is still planned. Good to know. For now I'll just rely on the full path (thus including the name of the default action).

Regards,
Sven

Reply by email

Unknown author
to Unknown author: And what exactly is the problem ? You can set the default module name in the…
Show quoted text 17 lines
On Fri, 9 Mar 2012, Sven Barth wrote: > I'm using the embedded webserver variant and the error only surfaced after > I added a second module which let's me assume that the problem is the same > as this: > http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-June/063655.html And what exactly is the problem ? You can set the default module name in the TFPWebApplication. But in that case, the path is interpreted as the action to execute, so the correct URL would be http://localhost:4321/list to have the module first requires an additional property and patch. This is planned.

I implemented the 'PreferModuleName' property in TWebHandler and TFPCustWebApplication in rev. 20495.

if set to True, then the URL

http://localhost:4321/treenode/

will select the 'treenode' module.

Default for the new property is currently 'False', which is backwards compatible.

Michael.

Reply by email