-
FEATURED COMPONENTS
First time here? Check out the FAQ!
***SOLVED***
Hi,
I'm trying to add the page to favorites using javascript.
But to to that i need to the get the complete url of the current page using Java.
How can I do that ?
Thank you for help
To be clearer in url like : http://www.someserver:8080/anApplication/aPage.zul?no=343&dem=aadd
I need this part http://www.someserver:8080/anApplication/aPage.zul
Or this part http://www.someserver:8080/anApplication/
I tried Executions.getCurrent().encodeURL(uri) but It dont seem to add any part to the uri
Any idea ?
Thank in advance
EDITED 25/05/2009 :
Thank you robbie its working
String port = ( Executions.getCurrent().getServerPort() == 80 ) ? "" : (":" + Executions.getCurrent().getServerPort()); url = Executions.getCurrent().getScheme() + "://" + Executions.getCurrent().getServerName() + port + Executions.getCurrent().getContextPath() + Executions.getCurrent().getDesktop().getRequestPath();
Executions.getCurrent().getServerName() returns the severname ex.zkoss.org
Executions.getCurrent().getDesktop().getRequestPath() returns /app/index.zul
the rest of it can be found in javadoc.
/robbie
Thanks, great example.
Asked: 2009-05-22 16:37:12 +0800
Seen: 2,193 times
Last updated: Oct 17 '13