[Lazarus] EmbWeb: Moving between webapp type caveats
Joost van der Sluis
joost at cnoc.nl
Sun Jun 12 19:37:36 CEST 2011
On Sun, 2011-06-12 at 09:02 -0700, leledumbo wrote:
> Thanks for answering, however the problem is not yet solved.
>
> > The whole point of fpweb is to abstract away the source of the information
> > of the request.
>
> I know, but as I said something that works across the webapp type (like the
> base url) should exist.
>
> > The Application.ApplicationURL is set to this.
> > In a webmodule, the module's URL is available in BaseURL.
>
> Doesn't work. Application.ApplicationURL is empty in both embedded server
> and CGI (I put it in a unit because of the ifdef in used units). The BaseURL
> of the module works, but without the preceding URL (hostname and port) it's
> kinda useless for URL generation.
It's not always possible to get the Application-URL. That's a problem
with other server-side weblanguages too. It's not only the host, but the
path to your application can also differ. My applications only use
relative URL's, to solve this problem. When the URL is really needed
(for example when you send an email to reset a assword) I read the URL
from a xml-file.
Joost.
--
My Lazarus blog: http://www.lazarussupport.com/lazarus/weblog
More information about the Lazarus
mailing list