IBM



2.6.2 Custom JSP tags

There are three WebSphere Commerce Flow custom tags:

<ifEnabled>

This tag, along with its complement <ifDisabled>, is used to include or exclude portions of a JSP page. For example:

<flow:ifEnabled feature="search">

portion of JSP page related to feature search

</flow:ifEnabled>

In this example, the tag handler will look in the SCF to see whether it contains the feature the value of whose id attribute is search. If it does, the body of the ifEnabled element will be processed as usual; otherwise, the body will be skipped. The <ifDisabled> tag works in the opposite manner. The body of the element is processed if the SCF does not contain the specified feature.

<url>

This tag retrieves the URL to be used in a form or link. For example:

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

In this example, the tag handler will attempt to retrieve the URL to be used for exit 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 used to retrieve 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"/>

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

To use WebSphere Commerce Flow custom tags, JSP pages must import the flow tag library by means of the following tag library directive:

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

// Clear related topics


Redbooks
ibm.com/redbooks


+

Search Tips   |   Advanced Search