setScheme (XSPUrl - JavaScript)

Sets the scheme (protocol) of the URL.

Defined in

XSPUrl (JavaScript)

Syntax

setScheme(scheme:string) : void
Parameters Description
scheme The new scheme.

Example

This example sets the scheme 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>>>