Back Forward Introducing JavaServer Page tags

JavaServer Pages tags

The Process Commander JSP tag library contains seventeen tags. You can use these tags in all stream rule types, including correspondence, XML Stream rules, and user interface rules.

Syntax basics

JavaServer Page tags are well-formed XML elements. Close each tag with a corresponding, correctly nested close tag (/). For example:

<pega:choose>
<!-- additional HTML, XML, and JSP tags here -->
</pega:choose>

Some tags can be self-closing, for example:

<pega:reference name=".pyIndex" />

Each tag in the Process Commander tag library begins with the pega: prefix, except for the r tag, which begins with a p: prefix.

To work with

Use these tags

Properties

Use these tags to work with properties.

  • reference — insert a property value for a property on the clipboard
  • lookup — insert a property value for a property not on the clipboard
  • withEmbedded — set the current embedded page
  • withPage — change the base page
  • withTarget — override the HTML Property rule that controls presentation
  • withReference — override the current active property
HTML fragments or other HTML rules

Use the include tag and the onlyonce tag.

Anchors, FORM tags, and SUBMIT buttons

Consider the url tag.

Conditional processing

Use the when tag and the choose tag.

Iteration and looping

Use the forEach tag.

Output of a list view rule

Use the listView tag.

Static file bundles

Use the static tag, which can contain bundle and file tags.

Drop-down lists for a text box value in a form

Use the autoComplete tag, which contains an acDataSource tag and may contain dsFields and dsField tags.

Static images

Use the contentURL tag.

Inline Java

Use the normal brackets <% and %> to enclose one or more executable Java statements (a scriptlet) within a JSP stream:

<p>So he said to me <% if(!hasError) {try .... }
                         catch (Exception e) { ..} %> is great.

Use the <%= and %> brackets when calling a function or returning a value such as a string to be inserted into the stream:

<p>Your last payment is due on <%= payoffdate(360, mon).toString() %>.

Comments

Within a JSP tag, you can use the standard JSP comment delimiters <%-- and --%> to mark material that is to be ignored as a comment.

Similarly, JSP tags within the Java <% and %> delimiters or <%= and =%> delimiters is ignored during JSP processing.

Definitions Jasper, stream rule types
Related topics JavaServer Page tags
Converting from directives to JavaServer Pages

More about JavaServer Page tags

JavaServer Pages tagsAbout JavaServer Page tags