Webapp.handleurl show web page?

Hi there,
is it possible, and how, to open some app webpage from the handleurl event ?

https://127.0.0.1:8080/?Key=XXYYY
I want to connect to the app using some key I put in a request url
and display a web page depending on that key?.
or do I need to deal with this on another part of the app ? the session ?
thanks.

in session.open you can check
session.URLParameter

this seems for Web API1 ?
and now in Web 2 the session.URL contains the session identifier

I could use a hash instead of a request, it would appear in session.Hashtag
but how to respond to a request like ?Key=xxxx and do something with web pages
and not just a web service with no page ?

Seems you are having a confused conversation with yourself :slight_smile:

The answer to your original question (as it is posed) is yes, you can do this:

myapp.com/page1

Then you are talking about hashing etc. Really think you either need to specify more detail of your requirement or stop overthinking it.

What about something like this ?:

myapp.com/page1?param1=blah

One of the bits you have not mentioned at all is the need to identify the request - i.e. who is the request coming from.

NOTE: In my example I return normal html pages - assume you meant return a Xojo web page ? If that’s the case, then don’t think you can do that from HandleURL but use the hashtag

this is for registering a user. he receives a link in an email like
myapp.com/resetpw?key=xxxxx

is session.opening the best place to intercept this url and display the registerwebpage if the key is valid ?
or do I need a link like myapp.com/#resetpw?key=xxxxx

I don’t do Web 2 but that URL will return a 404 unless you handle it in HandleURL and return True. Given it is HandleURL, it is (in and of itself) session agnostic.

This is the best thread with an example of session management from HandleURL provided by @Greg_O_Lone :slight_smile:

HandleURL Session Specific - Targets / Web - Xojo Programming Forum

In any case think you’ll need to return a ‘normal’ HTML page from this request if handling in HandleURL.

Missed your second suggestion - yes, that’d enable you to do your thing in a Xojo WebSession and show whichever Xojo web page you wish to show etc

One example of navigating using the hashtag which seems to be where you are aiming:

Navigating_Hashtag

http://documentation.xojo.com/api/web/websession.html#websession-urlParameter

just check the value in Session.Open and show a different page if required.

1 Like