BBjspWebRequest::getParameterValues (Deprecated)

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

Description

In BBj 16.0 and later, this method returns all of the parameter values associated with this parameter name.

Syntax

Return Value

Method

BBjVector

getParameterValues(string name)

Parameters

Variable

Description

name

The name of the parameter to retrieve

Return Value

a BBjVector containing the parameters' values

Remarks

The example below shows getting the parameters and their values from a request within a BBJSP Servlet.

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>
        <c:iterate data='<%= #getRequest().getParameterNames()' id='name'>
            ${name} :
            <%
                REM = Get the "name" from the page context
                name$ = #PageContext!.getAttribute("name")
            %>
            <c:iterate data='<%= #getRequest().getParameterValues(name$)' id='value'>
                <li>${value}
            </c:iterate>
        </c:iterate>
    </body>
</html>

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("<html><body><h1>Hello from BBJSP</h1>")
    vectNames! = #request!.getParameterNames()
    szN = vectNames!.size()
    if szN then
      for i = 0 to szN-1
        name$ = vectNames!.get(i)
        vectValues! = #request!.getParameterValues(name$)
        szV = vectValues!.size()
        if szV then
          for j = 0 to szV-1
            value$ = vectValues!.get(j)
            s!.write(name$ + value$)
          next j
        endif
      next i
    endif
    s!.write("</body></html>")
  methodend
classend

See Also

BBJSP

BBjspWebRequest

BBjVector