BBjspPageContext::getResponse (Deprecated)

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

Description

In BBj 16.0 and higher, this method returns the BBjspWebResponse associated with the BBjspPageContext.

Syntax

Return Value

Method

BBjspWebResponse

getResponse()

Parameters

None.

Return Value

the BBjspWebResponse associated with this context

Remarks

Although you can use this method to get the BBjspWebResponse you should use the build-in field #Response! .

Example

This example demonstrates how this works in a BBJSP widget

REM ===
REM === A BBjspWidget that counts page-visits for the user.
REM ===

class public PageCounterWidget implements BBjspWidget

  method public void open(BBjspPageContext context!)

    context!.runPipelineByName("MyPipeline")
    
    request! = context!.getRequest()
    response! = context!.getResponse()
    session! = context!.getSession()
    data! = context!.getBBjspSession()

    ct = 0
    if data!.contains("VISIT_COUNT") then
      ct = num(data!.getAttribute("VISIT_COUNT"))
    endif
    ct = ct + 1
    data!.setAttribute("VISIT_COUNT",str(ct))
    
    context!.saveBBjspSession()
    
  methodend

classend

See Also

BBJSP

BBjspPageContext

BBjspWebResponse