[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gb.web WebPage.Render problem on Apache


On 3/26/24 02:42, Benoît Minisini wrote:
Le 25/03/2024 à 07:46, T Lee Davidson a écrit :
If a WebPage is set as the startup class, files in the .Public directory are served properly. But, if another module calls WebPage.Render on that same page, the files are not served up properly. IIRC, I've run into an issue similar to this before running a gb.web app on Apache, but I think it got fixed.

The attached project has a MainPage webpage and a Main module that calls MainPage.Render. With MainPage set as the startup class, the application works fine. If Main is set as startup, it does not.

Perhaps I am misunderstanding the intended use of .Render().


Of course. By doing that, you short-circuit the startup method of the WebPage class that handles the ".public" project directory.

The 'Render()' method is just for generating the HTML of the web page.

Look at the source code of 'gb.web', and you will see what must be done exactly, if this is really what you want.

Regards,

I've been looking at WebPage.class, starting with .Render().

That really confused me because .Render calls Me.__Render which calls Me._Render which ... appears to do nothing as it has no code! Now as I understand it, this is because that relevant code is generated at compile time: "The Gambas compiler takes the WebPage source file [...], and generates the code for its Render method."

I think the key part I need is lines 19 - 27, which is essentially:
If the request is for a file, send it;
otherwise, render the WebPage (or in my case, decide which content to serve/render).

Thank you for the response, Benoît.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


References:
gb.web WebPage.Render problem on ApacheT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: gb.web WebPage.Render problem on ApacheBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>