Develop > Presentation layer > Work with JSP pages > Storefront customization tools > WebSphere Commerce Flow infrastructure


WebSphere Commerce Flow custom JSP tags

The three WebSphere Commerce Flow custom tags are...

To use WebSphere Commerce Flow custom tags, JSP pages must import the flow tag library:

<%@ taglib uri="flow.tld" prefix="flow" %>

The WebSphere Commerce Flow custom tags can be used in the following ways:

<ifEnabled>

This tag, along with its complement <ifDisabled>, includes or excludes portions of a JSP page. For example:

<flow:ifEnabled feature="search">     
    portion of JSP page related to feature search
</flow:ifEnabled>

The tag handler in this example looks in the Site Configuration File (SCF) to see if it contains the feature value of whose id attribute is search. If it does, the body of the ifEnabled element is processed as usual.

Otherwise, the body is skipped. The <ifDisabled> tag works in the opposite way. The body of the element is processed if the SCF does not contain the specified feature.

<url>

Retrieve the URL to be used in a form or link. For example:

<a href="<flow:url exitPort="port"/>">This link</a>

The tag handler in this example attempts to retrieve the URL to be used for exit port port from the SCF. The page containing this tag must be represented in the repository by an actual-page element. The exit-port ID used in the tag, port, must be the ID of some exit-port element within an actual-page-interface element.

<fileRef>

This tag is retrieves the URL of a non-JSP or non-HTML file asset, such as a style sheet, image file, or directory. For example:

<flow:fileRef id="vfileLogo" fileId="vfile.logo"/>

The tag handler in this example attempts to retrieve the URL of the file-ref element with ID vfile.logo from the SCF. It creates a scripting variable, vfileLogo, of type String whose value is the retrieved URL. If the id attribute is omitted, the tag handler does not create a variable and instead puts the retrieved URL onto the output stream as part of the HTML document sent back to the browser.


Related concepts

WebSphere Commerce Flow infrastructure

Related reference

WebSphere Commerce JSP programming best practices


+

Search Tips   |   Advanced Search