About handlespecialURL

I have an application that handles ‘special’ urls using handleSpecialURL in my App.
at the moment it constructs a web page by using command like this:

Request.Print("<!DOCTYPE html>" + EndOfLine) Request.Print("<html>" + EndOfLine) Request.Print("<head>" + EndOfLine) Request.Print("<title>Example Output</title>" + EndOfLine) Request.Print("</head>" + EndOfLine) ...

But what if i have a webpage class what do i do in the event handler to show the requestor that page instead of trying to print out the html?

You should try to use HandleURL as it is new and improved.

In reference to your question you want to use a Xojo WebPage instead of always writing your HTML?

I’m using handle special url unless it’s deprecated…
Are you saying I should be able to intercept all url calls to my application in that event?
But I’m afraid I don’t understand your answer to my question Phillip…

I do not believe it is deprecated. Only different is HandleSpecialURL can only capture requests that are in /api/or /special/

Can you clarify: “But what if i have a webpage class what do i do in the event handler to show the requestor that page instead of trying to print out the html?”

HandleURL intercepts all calls to the app, including normal operation at the root.

That’s almost true. It does not intercept a handful of urls that are necessary for sessions to work.

See http://documentation.xojo.com/index.php/WebApplication.HandleURL for more info.

One thing I know is that returning true will very effectively prevent a normal session to connect. I thought that could be very effective for a login system.

That’s true if Request.Path = “”.

Guys!? :slight_smile:
How do I set the response page?

[quote=363462:@Brian O’Brien]Guys!? :slight_smile:
How do I set the response page?[/quote]
If it’s a WebPage object, you don’t do anything and let the framework handle it for you.

If you’re looking to redirect a user to a specific page once they’ve connected, just do something like this in Session.Open

LoginPage.Show