Get full URL on a TiNG client

Hi

Is there a way to get the full URL from a TiNG-Client? application.getServerURL() only gives for example “http://localhost:8297/” without the rest like context, solutionname and stuff like that. Even if in the documentation there is written “For a NGClient this will be the url that the user sees in the browser url bar.
For Headless pure server based clients this will just be http://localhost[:port]”!

Or is there another way to get the context? We need to know the context because we have sometimes multiple installation (prod-, demo-, test) on the same application-server and depending on that we do stuff. So the url differs only in the way like “https://www.xyz.com/**myapp-test**/solution/…” and “https://www.xyz.com/**myapp-demo**/solution/…” and “https://www.xyz.com/**myapp-prod**/solution/…”

Best
Roland

Servoy version 2024.3.3 -releaseNumber 3946 (builddate: 2024-07-19 11:26)

The context in which the app server is running will be included in application.getServerURL(). So the full URL can be calculated as

application.getServerURL() + 'solution/' + application.getSolutionName() + '/index.html';

Hi Patrick

Thanks for your reply.

Obiously I misunderstood the tooltip of the function “application.getServerURL”. I assumed that it will return the full URL and then I created a regular expression to extract the context out of the URL. But because “application.getServerURL” only returns the first part of the URL (the server address plus the context) my regular expression failed. And on a developer you couldn’t really test these things, because you never have a “context” in developer.

I fixed my regular expression now and deployed it on a testsystem and now it delivers the context as I expected it.

Thanks again.
Roland