BBjspPageContext::getBBjspSession


Description

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

Syntax

Return Value

Method

BBjspSessionData

getBBjspSession()

Parameters

None.

Return Value

the BBjspSessionData associated with this context

Remarks

None.

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

BBjspSessionData