Project

General

Profile

Internal Path When Application is Created

Added by Ben Jackson about 11 years ago

I'm trying to make an application work properly with internal paths. I think I understand the basics, and I have working WAnchors that fire internalPathChanged, which is handled by a working slot. But I'm stuck on how load the correct state the path the initially launches the application. I feel like I must be missing something obvious here.

My first problem is that before the first call to setInternalPath(), internalPath() always returns the empty string, regardless of whether I launched the app from http://example.com/rootofapp or http://example.com/rootofapp/a/b/c/d. How can I tell what my initial path should be?

My second problem is that setInternalPath(p, true) doesn't fire a change event if the internal path is already p. I can see the logic in this, but in the case of initializing the application, if I call setInternalPath("/") from the constructor of my app, no event is fired if the launch URL is http://example.com/rootofapp. Similarly, if I call setInternalPath("/a/b/c/d") from the constructor, no event is fired if the launch url was http://example.com/rootofapp/a/b/c/d. This suggests that Wt knows what the initial internalPath() is, despite the fact that it tell me it is the empty string.

I see that the Wt homepage supports supports deep linking like this, and I looked at the source, but I couldn't find any magic. Is there supposed to be an internalPathChanged() signal firing at start up time that I'm not getting for some reason?

Any help? I'm using 3.3.0.


Replies (2)

RE: Internal Path When Application is Created - Added by Koen Deforche about 11 years ago

Hey Ben,

At application startup, WApplication::internalPath() really should contain the initial internal path. If not that's an (odd) bug in Wt or a deployment misconfiguration which could be the case for a FastCGI deployment that does not pass the 'PATH_INFO CGI parameter' properly to the Wt process.

How does your deployment look like?

Regards,

koen

RE: Internal Path When Application is Created - Added by Ben Jackson about 11 years ago

Koen,

Thanks for the reply. I'm embarrassed to admit the actual problem was that the debug line I was using to print the initial path to the console was badly formed. internalPath() works fine.

Ben

    (1-2/2)