BBjspPageContext::flush


Description

In BBj 16.0 and higher, this method flushes the output buffer and sends all written data to the client / browser.

Syntax

Return Value

Method

void

flush()

Parameters

None.

Return Value

None.

Remarks

This sample will flush the output buffer after each record of the table is sent.

Example

This example demonstrates how this works in a BBJSP web-page

<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>
<%@ taglib uri='/WEB-CFG/tld/sql.tld' prefix='sql' %>
<html>
    <body>
        <h1>Hello from BBJSP</h1>
        <sql:query template='tpl' var='result' datasource='ChileCompany' sql='SELECT * FROM SALESREP'>
            <sql:param value='8' />
        </sql:query>

        <table width='100%'>
            <tr>
                <th align='left'>Code</th>
                <th align='left' class='l'>Name</th>
                <th align='left' class='l' colspan='4'>Address</th>
                <th align='left' class='l'>Phone</th>
            </tr>
            <c:iterate data="${result}" id="item" >
                <c:template id='theRecord' template='${tpl}' data='${item}' />
                <tr>
                    <td>${theRecord['SALESPERSON']}</td>
                    <td class='l'>${theRecord['NAME']}</td>
                    <td class='l'>${theRecord['ADDRESS']} ${theRecord['ADDRESS2']}</td>
                    <td>${theRecord['CITY']}</td>
                    <td>${theRecord['STATE']}</td>
                    <td>${theRecord['ZIP']}</td>
                    <td class='l'>${theRecord['PHONE']}</td>
                </tr>
                <% #PageContext!.flush() %>
            </c:iterate>
        </table>
    </body>
</html>

See Also

BBJSP

BBjspPageContext