Search This Blog

GWT: extract protocol and host from url

AnchorElement anchor = Document.get().createAnchorElement();
anchor.setHref("http://youdomain.org/path/");
String protocol = anchor.getPropertyString("protocol");
String host = anchor.getPropertyString("host");
String path = anchor.getPropertyString("pathname");
anchor.removeFromParent();

No comments:

Post a Comment