Designing and Implementing Composite Applications 10.4 | Designing and Implementing Composite Applications | Getting Started with the webMethods Application Platform API | webMethods Tag Library for JSP | <webm:value>
 
<webm:value>
You use the <webm:value> tag to insert the values of one or more variables from the Integration Server pipeline into the HTML page produced from the JSP. You can also use the tag within a loop to insert the value of the loop’s current key. To do so, specify the tag without any arguments (that is, <webm:value/>).
Syntax
Separate nested fields with a forward slash (/).
<webm:value [variable="variable[/subvariable1/subvariable2/...
/subvariablen]"] [null="any_string"] [empty="any_string"] [index="n"]
[encode="code"] [decode="code"] [decimalShift="X"] [decimalShow="Y"]/>
Arguments
Argument
Description
[variable="variable [/subvariable1/ subvariable2/... /subvariable3]"]
Pipeline variable whose value to insert. Integration Server retrieves variable from the current scope. If you do not specify variable and you are inside a loop, Integration Server returns the value of the current key.
You can select a variable out of the current scope by using the required syntax, as follows:
*/variable - inserts the value of variable from the initial scope
*../variable - inserts the value of variable from the parent of the current scope
*variable/subvariable1/subvariable2/.../subvariable3 - inserts the value of subvariablen from variable
If you do not specify variablen, Integration Server assumes that the current element is within the current scope.
[null="any_string"]
When variablen is null, inserts any_string.
Example
<webm:value variable="carrier"
null="No Carrier Assigned"/>
[empty="any_string"]
When variablen contains an empty string, inserts any_string.
Example
<webm:value variable="description"
empty="Description Not Found"/>
[index="n"]
Inserts the nth element of the Document List or String List specified by variable.
Example
<webm:value variable="backItems" index="1"/>
[encode="code"]
Encodes the contents of variable before inserting it, where code specifies the encoding system to apply, as follows:
*xml - XML encoding
*b64 - Base-64 encoding
*url - URL encoding
[decode="code"]
Decodes the contents of variable before inserting it, where code specifies the decoding system to apply, as follows:
*b64 - Base-64 decoding
*url - URL decoding
[decimalShift="X"]
Shifts the decimal point in the value of variable to the right X positions before inserting the value. For decimal values only.
[decimalShow="Y"]
Truncates the value of variable to Y positions after the decimal before inserting the value. For decimal values only.
Examples
*This code calls the orders:getOrderInfo service and inserts the results of the service into the HTML page produced from the JSP.
<webm:invoke serviceName="orders:getOrderInfo"><br>
<p><webm:value variable="buyerInfo/companyName"/><br>
<webm:value variable="buyerInfo/acctNum"/>
<p>This shipment contains the following items</p>
<table width="90%" border="1">
<tr>
<td>Number</td><td>Qty</td>
<td>Description</td><td>Status</td>
</tr>
<tr>
<webm:loop variable="items">
<td><webm:value variable="stockNum"/></td>
<td><webm:value variable="qty"/></td>
<td><webm:value variable="description"/></td>
<td><webm:value variable="status"/></td>
</tr>
</webm:loop>
</table>
</webm:invoke>
*This code loops over the pipeline and inserts the names and values of the keys in the pipeline into the HTML page.
<webm:loop loopStruct="true">
<webm:value variable="$key"/><br>
<webm:value/><br>
</webm:loop>
*This code inserts the contents of the variable carrier into the HTML page. If carrier is null or empty, the code inserts the string “UPS”.
<webm:value variable="carrier" null="UPS" empty="UPS"/>

Copyright © 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release