Develop > Presentation layer > WebSphere Commerce foundation tag library
Tag: wcf:url
The wcf:url tag builds a URL and applies the appropriate WebSphere Commerce supported rewriting rules.
It contains the following additions compared to the c:url tag:
- It builds a full path URL, rather than a relative path.
- It builds SEO compliant URLs if the feature is used in WebSphere Commerce.
- It adds a prefix to the URL with the appropriate protocol, HTTP or HTTPS, depending on the Struts configuration files.
Tag Information Body Content empty Display Name url
Attributes
Name Required Request-time Type Description var false true java.lang.String The name of the exported scoped variable for the processed URL. value true true java.lang.String The URL to process. context false true java.lang.String The name of the context when specifying a relative URL resource that belongs to a foreign context. scope false true java.lang.String The scope for the variable specified by var. type false true java.lang.String Specifies if the current URL is used in an AJAX call. Valid type values are Ajax or Base. The default value is Base. If the type value is Ajax, the scheme for the URL is taken from the current request, rather than from the Struts configuration file.
Variables No Variables Defined.
Example
The following example forms a URL to display the shopping cart using the <wcf:url> tag. It specifies the URL type as an AJAX call.
<wcf:url var="currentShoppingCartLink" value="ShopCartPageView" type="Ajax"> <wcf:param name="storeId" value="${WCParam.storeId}" /> <wcf:param name="catalogId" value="${WCParam.catalogId}"/> <wcf:param name="langId" value="${WCParam.langId}" /> </wcf:url>