Hi all,
Is it possible to retrieve the URL from the addressbar (what the end-client typed in)?
I’ve searched everywhere, but just couldn’t find it.
Thanks.
Hi all,
Is it possible to retrieve the URL from the addressbar (what the end-client typed in)?
I’ve searched everywhere, but just couldn’t find it.
Thanks.
Do you mean application.getServerURL()?
This will return the used base URL (i.e. http://www.myDomain.com:8080/, http://app.myDomain.net:8181/, etc).
Well, I my case it returns ‘localhost’ instead of the url (or even ip-adress) that the user typed in.
I assume you are using the web client. Smart client will show the correct URL.
I guess you need to file a feature request for this.
Ok, thanks.
if it is a deepling to a solution
You get the parameters into your solution.
Or do you really want to know the server address they used?
We really want to know what address they typed in.
i guess a simple (web client) only java plugin or java code in js could give you that result if needed.
Something like this could work in js:
var requestUrl = Packages.org.apache.wicket.RequestCycle.get().getRequest().getURL();
I get the follwoing as result: servoy-webclient/?x=BCUB7LJ19fDyURr8TKHe9EZ1ZAhy1Zs3vDKvkTREVpBm9ads38KG-XA-IwSb7*0J
But probably there will be a method that will return the whole url, so i will look into that.
var requestUrl = Packages.org.apache.wicket.RequestCycle.get().getRequest().getHttpServletRequest().getRequestURI() ;
As of Servoy 5.2.1 application.getServerUrl() does return the base url from which the webclient is started.
Paul