BBjspWebRequest::getAttributeNames (Deprecated)
Description
In BBj 16.0 and higher, this method returns a BBjVector containing the
names of the attributes available to this request. This method returns an
empty BBjVector if the request has no attributes available to it.
Syntax
Return Value
|
Method
|
BBjVector
|
getAttributeNames()
|
Parameters
None.
Return Value
a BBjVecor containg the names of the request's attributes.
Remarks
None.
Example
This example demonstrates how this works in a BBJSP web-page
<%
REM == INITIALIZE SOME DATA
#Request!.setAttribute("foo","This is FOO")
#Request!.setAttribute("woo","This is WOO")
%>
<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>
<%
REM = Get the "name" from the page context
name$ = #PageContext!.getAttribute("name")
%>
- ${name} = <%= str(#getRequest().getAttribute(name$)) %>
|
This example demonstrates how this works in a BBJSP servlet
class public MyServlet
field private BBjspWebRequest request!
field private BBjspWebResponse response!
field private BBjspWebSession session!
method public void service(BBjspServletContext context!)
#request! = context!.getRequest()
#response! = context!.getResponse()
#response!.setContentType("text/html")
s! = #response!.getOutputStream()
#session! = #request!.getSession()
s!.write("Hello from BBJSP")
vectNames! = #request!.getAttributeNames()
sz = vectNames!.size()
if sz then
s!.write("")
for i = 0 to sz - 1
name$ = vectNames!.get(i)
s!.write("- " + name$ + #request!.getAttribute(name$))
next i
s!.write("
")
endif
s!.write("")
methodend
classend
|
See Also