Hartmut1
(Hartmut Flank)
November 8, 2012, 12:19am
1
Hi,
is it possible to get the domain and deploy path at vaadin (or java)?
For example I have a application running under:
http://www.mydomain.com/myNiceApp
I like to get “www.mydomain.com ” and “myNiceApp” into a String. How could I do this?
Greetings
Hartmut
Thomas54
(Thomas Hoenen)
November 8, 2012, 5:54am
2
in vaadin6 in Application init this. or with getApplication()
String server = ((WebApplicationContext) this.getContext()).getHttpSession().getServletContext().getServerInfo(); // returns zb Apache Tomcat/Version
java.net.URL url = this.getURL(); // this. is Application
String s = url.getHost()+“:”+url.getPort()+url.getPath(); // Port ist evtl leer
in case that was the question.
My question to all
how to do that in vaadin7, somehow, since i dont find the getUrl() there, still I didnt look for it too much yet…
Henri2
(Henri Sara)
November 12, 2012, 7:36am
4
My question to all
how to do that in vaadin7, somehow, since i dont find the getUrl() there, still I didnt look for it too much yet…
If you are interested in the point of view of a client, see Page.getLocation() - taking into account any URL remappings that may take place on (reverse) proxies for that client etc.