Object: dw.web.URLUtils

The Template Processor pre-imports dw.web.URLUtils, so the URLUtils class can be used within a template by its simple name.

Method Description
static abs(action : String, namesAndParams : String...) : URL Returns an absolute URL with protocol and host from calling context request.
static http(action : String, namesAndParams : String...) : URL Returns an absolute URL with HTTP protocol. If an insecure host is specified in preferences, the returned URL includes that host. Otherwise, it uses the host from the calling context request.
static https(action : String, namesAndParms : String...) : URL Returns an absolute URL with HTTPS protocol. If an insecure host is specified in preferences, the returned URL includes that host. Otherwise, it uses the host from the calling context request.
static httpsWebRoot() : URL Returns an absolute web root URL with HTTPS protocol and host and domain information from calling context request. If a secure host is specified in preferences, the returned URL includes that host. Otherwise, it uses the host from the request.
static httpWebRoot() : URL Returns an absolute web root URL with HTTP protocol and host and domain information from calling context request. If an insecure host is specified in preferences, the returned URL includes that host. Otherwise, it uses the host from the request.
static url(action : String, namesAndParams : String...) : URL Returns a relative URL.
static webRoot() : URL Returns a relative web root URL. It uses a web root URL to access all static media context for the site. It can reference the actual media file by appending a relative path.

Example:

<form action="${URLUtils.httpsContinue()}" method="post" id="${pdict.CurrentForms.login.login.htmlName}">