setHost (XSPUrl - JavaScript)

Sets the host name or address of the URL.

Defined in

XSPUrl (JavaScript)

Syntax

setHost(host:string) : void
Parameters Description
host The new host.

Example

This example sets the host for a new XSPUrl object.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

var url : XSPUrl;

try {
	url = new XSPUrl("");
	url.setScheme("http");
	url.setHost("myhost.ibm.com");
	url.setPort(10038);
	url.setPath("/wps/PA_cow3tik/page1.xsp");
	p(url.toString());

} catch(e) {
	p("Error = " + e);
}

Print output from the example is as follows:

<<<http://myhost.ibm.com:10038/wps/PA_cow3tik/page1.xsp>>>