ID | Name | Address 1 | Address 2 | City | State | Zip Code | Credit Limit | Discount Code |
---|---|---|---|---|---|---|---|---|
409 | Old Media Productions | 4400 527th Street | Suite 562 | New York | NY | 10095 | 10000 | L |
410 | Yankee Computer Repair Ltd | 9653 211th Ave | Floor 4 | New York | NY | 10096 | 25000 | M |
This example demonstrates an inline call to a Convirgance web service, the results of which is used to render a table.
Values are encoded using the
${virge:html(value)}
function to prevent HTML injection.
<%@taglib uri="convirgance:web" prefix="virge" %>
<virge:service var="customers" path="/customers/database">
<virge:parameter name="zipcode" value="${param.zipcode}" default="" />
<virge:parameter name="state" value="${param.state}" default="" />
<virge:parameter name="discountCode" value="${param.discountCode}" default="" />
</virge:service>
<virge:iterate var="customer" items="${customers}">
<tr>
<td>${virge:html(customer.CUSTOMER_ID)}</td>
<td>${virge:html(customer.NAME)}</td>
<td>${virge:html(customer.ADDRESSLINE1)}</td>
<td>${virge:html(customer.ADDRESSLINE2)}</td>
<td>${virge:html(customer.CITY)}</td>
<td><a href="?state=${virge:html(customer.STATE)}">${virge:html(customer.STATE)}</a></td>
<td><a href="?zipcode=${virge:html(customer.ZIP)}">${virge:html(customer.ZIP)}</a></td>
<td>${virge:html(customer.CREDIT_LIMIT)}</td>
<td><a href="?discountCode=${virge:html(customer.DISCOUNT_CODE)}">${virge:html(customer.DISCOUNT_CODE)}</a></td>
</tr>
</virge:iterate>