BBjspPageContext::getAttribute (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.

Description

In BBj 16.0 and higher, this method returns the object bound with the specified name within the specified scope, or null if no object is bound under the name. If the attribute was not bound within this BBjspPageContext then check and return if found the attribute within associated the BBjspWebSession.

Syntax

Return Value

Method

Object

getAttribute(string name)

Object

getAttribute(string name, int scope)

Parameters

Variable

Description

name

name of attribute to be retrieved

scope

specifies the context level (scope) of the attribute - if omitted then PAGE scope is assumed

Return Value

the value bound to the name

Remarks

None.

Example

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

<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>
<html>
    <body>
        <h1>Hello from BBJSP</h1>
        <ul>
            <c:iterate data="<%= #PageContext!.getAttributeNames() %>" id="name">
                <%
                    REM = Get the "name" from the page context
                    name$ = #PageContext!.getAttribute("name")
                %>
                <li><b>${name}</b> = <%= str(#PageContext!.getAttribute(name$)) %>
                <%
                    REM = Now remove the attribute
                    #PageContext!.removeAttribute("name")
                %>
            </c:iterate>
        </ul>
    </body>
</html>

See Also

BBJSP

BBjspPageContext