Stream processing of JSP tags

Stream processing is the runtime conversion and evaluation that converts an HTML or XML text containing JavaServer Page (JSP) tags into a final form.

Stream processing supports three capabilities:

  • User interface displays — HTML sent to a browser
  • Correspondence — HTML formatted and printed by Microsoft Word or sent as email
  • SOAP services and connectors — XML text in SOAP messages

Inputs

The inputs to stream processing are:

  • A rule containing

    Source HTML or XML text that typically contains JSP tags or directives — for example an instance of one of the Rule-Obj-HTML, Rule-HTML-Harness, Rule-HTML-Section, Rule-Obj-Corr, or Rule-Obj-XML rule types.
  • Other rules referenced through directives or JSP tags in the first rule, such as instances of the Rule-HTML-Fragment, Rule-Corr-Fragment, and Rule-HTML-Property rule types.
  • The clipboard, as a source of property values.
  • The database, as a source of property values.

Stream processing evaluates JSP tags — for example the <pega:reference> tag for property values, and the <pega:include> tag which incorporates HTML or XML text from another rule — as it encounters them in the original source HTML. If the result of a tag contains more tags, they are processed as well, in a depth-first way.

JSP tags provide great power and flexibility. In addition to property value text and HTML text substitution, JSP tags can:

  • Cause conditional exclusion of text based on evaluation of When conditions
  • Incorporate text output by Java functions
  • Retrieve property values from the database as well as the clipboard
  • Perform looping and searching
  • Save values found earlier into a scratchpad or internal symbol table, and use them later
  • Create an interactive chart

The output of stream processing is a well-formed HTML or XML document, containing no tags or directives.

Processing sequence

Stream processing first assembles runtime Java, evaluating those tags or directives (such as the <pega:include> tag) that don't involve the clipboard contents.

Next it compiles the Java, and finally it executes the Java to resolve clipboard references and produce the final HTML (or XML). For user interface rules, the HTML is sent to the Web server then to the user's browser.

Note:

Your stream rules can reference JSP tags in the text other than the Pega Platform tags, if the tags are in an external taglib JAR file.

A stream may contain a Java scriptlet — inline code bracketed by the <% and %> delimiters. This is an advanced capability to be used carefully.

Stream processing operates only on relative addresses. Fully qualified links are not altered, as in:

<a src="http://www.google.com">Google</a>

The rule classes that use stream processing are subclasses of the standard abstract class named Rule-Stream .

The JSP tags provided by Pega Platform follow the JSTL standard, defined by Java Community Process JSR-52.