BBjHttpSession


Creation Path


BBjServletEvent

|

+-- BBjHttpRequest

    |

    +-- BBjHttpSession


Description

In BBj 12.0 and higher, BBjHttpSession provides session-specific storage for HTTP sessions.

Creation

A BBjHttpSession object is obtained with the following BBjHttpRequest method:

Return Value

Method

BBjHttpSession

getSession()

Methods of BBjHttpSession

Return Value

Method

string

getAttribute(string name)

BBjVector

getAttributeNames()

BBjJettyContext

getContext()

long

getCreationTime()

string

getId()

long

getLastAccessedTime()

int

getMaxInactiveInterval()

void

invalidate()

boolean

isNew()

void

removeAttribute(string name)

void

setAttribute(string name, string value)

void

setMaxInactiveInterval(int time)

Remarks

None.

Example

REM Obtain the instance of the BBjAPI object

LET myAPI!=BBjAPI()

MyServlet! = new MyServlet()

 

data!.setCallback(data!.ON_WEB_CONNECTION, myServlet!, "myMethod")

 

PROCESS_EVENTS

 

class public MyServlet

  method public void myMethod(BBjServletEvent p_event!)

      LET chan = UNT

      request! = p_event!.getBBjHttpRequest()

      response! = p_event!.getBBjHttpResponse()

      resp!.setContentType("text/html")

      open(chan)"JSERVLET"

      print(chan)”<html><body><h1>Hello BBj!”

      close(chan)

  methodend

classend

See Also

BBjAPI

BBjServletEvent

BBjHttpRequest

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.